Fork me on GitHub
#lsp
<
2023-02-20
>
pmooser08:02:30

I'm using clojure-lsp in emacs, and in my project, I'm pulling in another project locally (using :local/root in my deps.edn). In this configuration, I see that I'm getting some invalid/incorrect errors (specifically, invalid-arity) for some functions being used from that locally-included project. Any hints on how to debug/improve this? I just end up turning off lsp in those namespaces, instead of seeing incorrect errors.

pmooser08:02:17

I wonder if somehow it's seeing an old version of the project, maybe from before it was a local import, or something like that.

pmooser08:02:53

I'm also seeing an incorrect unresolved-var which is what is making me wonder if clojure-lsp / clj-kondo are somehow resolving to the old jar library instead of the locally included project.

borkdude09:02:44

It's hard to talk about any specifics without having the actual repro that we can run ourselves

pmooser11:02:03

@U04V15CAJ Not all projects are open source. Maybe I can create a mini demo or something that reproduces the problem. I'll let you know if I manage to do so.

borkdude11:02:31

yes, a repro in the form of a mini-project would certainly help

borkdude11:02:14

you can try to blow out the .lsp/.cache and .clj-kondo/.cache directories and restart lsp

ericdallo13:02:13

I would suggest avoid removing the cache unless we don't know what is (to find the root cause) @U07VBK5CJ a mini repro would be useful indeed, also, you can run clj -Adev:test -Spath to check the classpath clojure-lsp is considering

pmooser12:02:18

I'm sorry, but I did remove the caches - if I run into this issue again, I will at least save what I have before I do that.

Drew Verlee18:02:34

How do i have it so that the function signature displays when i'm filling out the arguments of a function. E.g (foo [x y] ...) So where * i the cursor if i type... (foo * would display: [x y] (x is bolded or stands out) then (foo 1 * would display: [x y] Where y is bolded or stands out

Drew Verlee18:02:42

The issue could be that my modeline in spacemacs isn't setup correctly for LSP.

Drew Verlee18:02:13

in doom at least it displays the function and signature, but it doesn't highlight the argument I'm currently on.

Drew Verlee18:02:42

i feel like what i want is for the signature to appear as something i'm writing over, at least to start, like: (foo *x y) and then i type a letter for x it removes the hint (x).

Drew Verlee18:02:24

ok, now the fn signature is displaying in spacemacs to. i'm going to have to video record this as it seem random. But still, i'm guessing argument highlighting is an option i can turn on somehow?

Drew Verlee18:02:53

maybe my computer is too slow lol.

Drew Verlee19:02:12

Now the spacemacs modeline displaying the wrong function signature for where my cursor is.

Drew Verlee19:02:32

I feel like the problem child, i guess ill just continue my migration to doom emacs where pastures are hopefully greener.

ericdallo19:02:53

The feature you want is signature help from the LSP spec, it's triggered via lsp-signature-enable IIRC, or C-S-SPC in doom

👀 2
ericdallo19:02:56

What you see in the mini buffer is from hover LSP feature, there is an idea of showing the current arg in hover as bold, but that could be flaky as hover requests are cached and not intended to check the signature help constantly but for docs and more info about current symbol

👀 2
Drew Verlee21:02:00

@UKFSJSM38 that definitely looks like what i want.

ericdallo21:02:35

It's the lsp-signature feature using posframe from lsp-ui