This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-20
Channels
- # aleph (78)
- # announcements (13)
- # architecture (8)
- # aws (3)
- # babashka (110)
- # beginners (38)
- # calva (2)
- # clerk (1)
- # clojure (118)
- # clojure-austin (3)
- # clojure-dev (8)
- # clojure-europe (50)
- # clojure-france (2)
- # clojure-nl (1)
- # clojure-portugal (1)
- # clojure-uk (3)
- # clojurescript (101)
- # clr (10)
- # data-science (15)
- # datascript (5)
- # datomic (3)
- # events (1)
- # fulcro (22)
- # graalvm (2)
- # gratitude (3)
- # guix (1)
- # honeysql (1)
- # hyperfiddle (72)
- # jobs (3)
- # lsp (23)
- # malli (18)
- # membrane (29)
- # obb (1)
- # releases (1)
- # ring-swagger (2)
- # shadow-cljs (8)
- # squint (113)
- # xtdb (9)
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.
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.
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.
It's hard to talk about any specifics without having the actual repro that we can run ourselves
@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.
you can try to blow out the .lsp/.cache
and .clj-kondo/.cache
directories and restart lsp
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
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.
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
The issue could be that my modeline in spacemacs isn't setup correctly for LSP.
in doom at least it displays the function and signature, but it doesn't highlight the argument I'm currently on.
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).
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?
maybe my computer is too slow lol.
Now the spacemacs modeline displaying the wrong function signature for where my cursor is.
I feel like the problem child, i guess ill just continue my migration to doom emacs where pastures are hopefully greener.
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
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
Check the gif for an example: https://clojure-lsp.io/features/#signature-help
@UKFSJSM38 that definitely looks like what i want.
Nvm not related with lsp-ui, it's just this setting: https://github.com/ericdallo/dotfiles/blob/master/.doom.d/config.el#L136