hi all, Is there a way to make lsp find references to usage of forms in rich comment blocks? some of my code looks like dead and unused from LSP point of view, while in reality it is used in rich comments...
should work, evidence in screenshot, unless you have configured clj-kondo to "skip comments"
duh facepalm Thank You!
you can make both work, by not using :skip-comments, but by doing this in clj-kondo instead:
{:config-in-call {clojure.core/comment {:ignore true}}}also you need to configure cljs.core/comment as well
and is this visible in call-heriarchy? like a Comment common parent? i guess not...
not sure what you're referring to, here ends my clj-kondo + lsp integration knowledge, I'll happily defer the rest to @ericdallo
yeah, thanks a lot. i am not really sure about that too. rather new space for me 🙂
@borkdude what that does?
{:config-in-call {clojure.core/comment {:ignore true}}}I only knew the skip-comments
@karol.adamiec you mean show in the call hierarchy tree lsp feature the comment ? or in find references?
:ignore true means the same as turning all linters off
skip-comments true means: don't even look at (analyze) this
ahh makes sense, so LSP features will keep working with the ignore true
good to know, will change nubank to use that
sounds like a better move indeed
you mean show in the call hierarchy tree lsp feature the comment ?
exactly that.
yeah, that's not supported because I never thought about it 😅 but sounds convenient, feel free to create a issue about it, also would be best if you provide code or even images of what you want to make the issue clear
ok, thanks.
I am not sure myself how useful that is. artificial call site like comment, this came up in team discussion...
Did anybody else experience this issue with clojure-lsp and lsp-mode in emacs?
The lsp diagnostics don’t refresh in the buffer after changes were made. An example:
• I have a diagnostic saying variable is not used, if I move that variable to another line, the diagnostic squiggly underline will still be shone at the previous line and I have to hit lsp-restart-workspace to trigger a refresh for LSP
This happens only with clojure-lsp. Has this been reported before?
This was the final tipping point, and I declared emacs bankruptcy. I just finished remaking my config. It works now.
It uses the same clojure-lsp binary I had before, so it’s clearly not an issue with clojure-lsp itself. My assumption is that it was because I had lsp-enable-file-watchers set to false. From the docs: If non-nil lsp-mode will watch the files in the workspace if the server has requested that.
It works now. Thank you guys for the support!
glad it's working, but I don't think it was related to file watchers, that's a feature only for, for example, if you switch git branchs (you changed code not via editor), so lsp-mode knows about it and ask server to re-analyze those file changes.
Ah, I see. Good to know. Then, I don’t know what caused the issue
I've had issues like this with flycheck as well, outside of lsp. Only happens once in a while and then I have to just close and re-open the file
For me it is a persistent issue. It’s like the LSP doesn’t update the latest version of the file. Here’s a video of this scenario, note the symbol highlight when cursor is over button component. LSP will highlight 2 positions where it knows the occurences of the button are, but they are way down
Curious if anybody has experienced this issue where LSP doesn’t update its context related to the open buffer
@ovidiu.stoica1094 from your video, does lsp-mode receive the publishDiagostics notification from server?
Coming back to this, this was happening because I also had tailwindcss as an addon LSP provider in the same buffer.
It started happening again now that I added it back, and it behaves correctly again if I only have clojure-lsp active in the buffer
https://github.com/merrickluo/lsp-tailwindcss misbehaves in some situations (providing completions where it shouldn’t), so I’ll just disable it for now.
Happy to add this to a list of things people should watch out for if there is one