This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-10
Channels
- # announcements (9)
- # babashka (19)
- # beginners (39)
- # calva (7)
- # cherry (1)
- # cider (2)
- # clojure (31)
- # clojure-europe (8)
- # clojure-norway (9)
- # datalevin (10)
- # events (2)
- # fulcro (10)
- # hyperfiddle (9)
- # joker (1)
- # lsp (50)
- # membrane (34)
- # minecraft (2)
- # missionary (21)
- # off-topic (17)
- # pedestal (1)
- # polylith (8)
- # reitit (3)
- # sql (4)
- # squint (16)
- # xtdb (14)
LSP noob question. Trying to get it working with java sources in neovim (native lsp without coc.nvim). I keep getting following error when trying to navigate to external java sources:
{
error =
{
code = -32603,
data = {
id = 80,
method = "textDocument/definition"
},
message = "Internal error"
},
id = 80,
jsonrpc = "2.0"
}
I get this error when trying to navigate to external non core java libraries. But JDK sources returns "No location found"
@ericdallo turned on trace, and restarted LSP: https://gist.github.com/armed/4c23005fbf134c4c118d85b80114fe3e
and this is what happening when I go to definition on non core java dependency: https://gist.github.com/armed/501e8153d438483f2333c286df2f3437
java core souce (e.g. BufferedReadStream): https://gist.github.com/armed/d747b5276466f0ddf9e9e992ebcd88dd
I’m using asdf tool to manage directory based JDK versions, can this affect? As soon as I cd to the project directory JAVA_HOME and java bin path changes to configured version
@U34K4458X sorry, I meant this https://clojure-lsp.io/troubleshooting/#server-log
Also, before re-try could you try rm -rf ~/.cache/clojure-lsp/
@ericdallo ah, ok. Actually it started jumping to java sources after I removed cache dir. But still throws exception when I try to jump to google.guava deps. Logs say something about zip format. https://gist.github.com/armed/74e6de58d8b4b87b52cd9d643ad289ab
So my cache dir was somehow broken? Can this be because I change JDK version from project to project?
Not sure @U34K4458X 😅 if that start to happens again LMK About the exception, looks weird indeed, from log it seems related with formatting code with cljfmt, did you call format from your editor?
I didn’t call format when recorded that logfile, but when I run lsp format all works fine. and that “The URL protocol zipfile is not tested and might not work as expected.” occurs only on one of the dependencies, weird.
@U34K4458X I think is related with https://github.com/clojure-lsp/clojure-lsp/blob/master/lib/src/clojure_lsp/feature/java_interop.clj#L104
I think there must be a fix not that hard for that, please open a issue with a detailed repro so we can take a look later
At leas I know the reason now. feeling much better )) I’ll create a repo with all the stuff to reproduce and open an issue
@U34K4458X created a branch which should fix the issue, could you test it please?
https://github.com/clojure-lsp/clojure-lsp/pull/new/fix-zipfile-class-decompilation
Just clone clojure-lsp and run bb debug-cli
to build a local clojure-lsp executable
Compiled from that branch, replaced existing binary. Still getting that error. Minimal repo: https://github.com/armed/lsp-nvim-zip-issue/
@ericdallo it shows same version as release though
calva uses jar scheme so it's not the same way vim uses, are you sure coc/nvim is using that clojure-lsp? The version output is not reliable for dev local builds unfortunately
Hum, this exceptions seems like a different bug I know how to fix, but it should happen only on native-images compiled with Graal, not via bb debug-cli
I’m not using coc.nvim, using native lsp. And I simply replaced nvim’s binary with compiled one
hmm, ok so I might be replaced the wrong one. But I double checked by deleting binary and nvim’s lsp stopped working. So the path is right imo.
Thank you for making clojure DX so great! I’m happy as never today. Now I can use nvim as a daily driver without any quirks.
lsp-organize imports removes imports that are necessary for some macro to work. I annotated them with:
#_:clj-kondo/ignore
["fs" :as fs]
#_:clj-kondo/ignore
["path" :as path]
but lsp still removes them. Maybe lsp can take into account: when clj-kondo does not report the ns as unused, it should not be removed?
/cc @ericdalloWe rely on kondo findings for that IIRC, so I would expect to not remove, maybe a bug, is that your code snippet enough for the repro?
I should probably upgrade my lsp- the newest one is based on the Clojure rewrite right? Does it also do the lazy analysis by default? How's the stability been?
@ericdallo I tested with the newest one and the issue persisted: https://github.com/clojure-lsp/clojure-lsp/issues/1237