Fork me on GitHub
#lsp
<
2023-05-17
>
dharrigan07:05:34

You know what would be nice (perhaps it exists already?) is to have a lsp action that does this:

dharrigan07:05:03

replace the :all with the suggestions in the :refer

👍 2
Martynas Maciulevičius08:05:11

I do it one-by-one: (deftest test-test) Go to deftest Run action Add import It's not ideal but it's a step towards something.

ericdallo11:05:07

It's done on master!

❤️ 2
Bryn Russell12:05:22

Hello everyone, is there any known issues using neovim with clojure-lsp? I cannot figure out why I'm getting micro-stutters (every 2 seconds I get ~100-300ms freezes) whenever I have clojure-lsp enabled. • I am restricted to using WSL2 on Windows. • There are no Windows files/links in the folder I am working in. • I am using Arch WSL2 with nvim v0.9.0. • There are no issues found when running :checkhealth. • There are no standard warning or errors logged anywhere as far as I can tell. :messages is empty as well. • The project I am working in is a ClojureScript project which uses both Leiningen and shadow-cljs • I have no issues in Calva or Doom Emacs. But I want to use neovim 😅 • If I check htop in another terminal window nvim --embed . takes up 50-100% CPU with a clojure-lsp attached buffer open (I started nvim in my project folder with nvim .) • I've tried disabling every plugin except what is required for clojure-lsp to run with Mason and I still have micro-stutters. • I am running Windows 10 21H2 • Here's my neovim config: https://github.com/greensponge/nvim I guess I'll just disable clojure-lsp when using neovim if we can't figure this out, but that would be a shame.

ericdallo11:05:10

I'm not aware of any clojure-lsp issues related to that, but I saw other people complaining about that ton neovim, I have no nvim experience, but It's probably something to be fixed on neovim side. Maybe @U7ERLH6JX or @UEENNMX0T know anything?

👍 2
Noah Bogart12:05:52

That’s pretty odd! I don’t have a windows machine or I’d give it a go myself. Which version of neovim are you using? Which clojure-lsp?

rafaeldelboni17:05:26

I use a similar setup on Linux and Mac and I have zero issues. If you add in your ~/.lsp/config.edn the :log-path "/tmp/clojure-lsp.out" and check if there is any regular log in there

rafaeldelboni17:05:52

BTW what installation of the clojure-lsp you are using the package from aur?

Bryn Russell11:05:48

Thank you for the responses, here's some additional context: I have installed: • neovim 0.9.0-2 from extra/neovim on my ArchWSL. • clojure-lsp 2023.05.04-19.38.01 with Masonaur/clojure-lsp-bin 2:2023.05.04_19.38.01-1

rafaeldelboni11:05:31

Uhm it's the binary then, I was afraid you were using the jar

Bryn Russell11:05:41

If I check /tmp/clojure-lsp.out as suggested I mostly have rows that look like this: 2023-05-26T11:32:16.574Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms Nothing out of the ordinary I think, it refreshes clojuredocs cache, analyze-files-in-watched-dir once etc. I have a few warnings like this: 2023-05-26T11:32:11.296Z WARN [clojure-lsp.kondo:328] - Non-fatal error from clj-kondo: No configs copied. But it's a non-fatal warning so not sure if that's relevant.

ericdallo13:05:11

Those logs are ok. Maybe you could get the <https://clojure-lsp.io/troubleshooting/#client-server-log%7Cclient&lt;-&gt;server logs> and check if server is taking time to do anything. But my guess is still nvim for wsl2 doing something different

☝️ 2
Bryn Russell12:05:19

Thanks for the suggestion, I didn't find anything in those jsonrpc logs either unfortunately. I believe you are correct @UKFSJSM38, that it's something to be fixed on the nvim side. If someone has any other ideas I'm open for it, though I'll just use some other editor that works until I'm not on Windows in the meantime.

ericdallo12:05:41

I think give visibility to nvim maintainers would be the best, otherwise we may just leave this issue where others may be facing, it could even be something that happen on nvim with other LSP servers, I suggest opening an issue in nvim

Bryn Russell07:05:43

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.

ericdallo13:05:33

Awesome, glad that is fixed!

frankitox17:06:42

Nice found @U058B377C57 🙏 this has been driving me insane too

👍 2