Fork me on GitHub
#vim
<
2023-05-16
>
Bryn Russell08:05:14

Hello everyone, I'm using neovim using packer and mason . I am restricted to a Windows machine using WSL2 and I am developing a ClojureScript application using shadow-cljs. I am also using Conjure, which might be relevant. I am listing these keywords in hopes you might understand my following issue: Everything is smooth usually, and if I install clojure-lsp using mason I get the helpful LSP features I would expect, but the editor starts micro-freezing every ~3 seconds for maybe 500ms each time. This makes the editor unusable. My question is, does anyone know why this could be? I've tried leaving the editor running for a while in case it does some slow caching, but that did nothing. Context: • As far as I can tell I am not mixing any Windows files and working strictly inside WSL2 with Linux files, as I've noticed even having one Windows file somewhere can cause severe performance issues. • I am running Windows 10 21H2 with the MS store version of WSL2 • The config I'm using: https://github.com/greensponge/nvim

👀 2
Martynas Maciulevičius09:05:50

I heard that when WSL2 tries to communicate with Windows then it's slow. Is it possible that you have a part of your editor on Windows side (let's say you run LSP there) and part of your editor in WSL side (nvim)? Is it possible to run LSP fully inside WSL2? This way you could at least avoid this network hop between your environments. Also somebody mentioned that if your project or temp files are located in Windows side and not WSL2 side then every time you interact with them you have this network hop. So for instance if nvim creates some kind of temporary file (let's say it's a .clj-kondo or .lsp temp files in your project root) then you could be unknowingly be changing their contents and it could be one of the sources for this freeze too.

Bryn Russell11:05:37

I've tried double checking but can't find anything, I have cloned down my project to ~/greensponge/myProject and all the .clj-kondo/.lsp etc. therein should be contained within WSL/Linux? I can't find anything that would reference back to Windows at least. I've also tried to re-install clojure, leiningen and used different versions of the jdk --currently using v17. Additional context, I'm using this Arch WSL: https://github.com/yuk7/ArchWSL

Bryn Russell06:05:54

I ruled out the WSL distro, I installed a fresh vanilla Ubuntu, cloned down my project to ~, and after setting up Neovim and getting it running I experience the same stuttering / freezing. ¯\(ツ)

Bryn Russell07:05:20

Good news! Looks like this was fixed with the latest neovim release (released 20h ago): https://github.com/neovim/neovim/commit/7d4bba7aa7a4a3444919ea7a3804094c290395ef Not sure which one of these fixes did the trick, but after updating to neovim 0.9.1-1 I can use the editor again with clojure-lsp in WSL2 without stuttering.

🥳 2