-
-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LSP] Can't find definition of external dependencies #1494
Comments
I'm looking into it. |
Ok so sadly it's not my change. As far as my testing shows it broke on 2.0.229 release. |
So it seems to be caused by #1431 ironically. |
Good finding @Cyrik, we could as last resource revert that, but it'd be perfect if we would understand why this happen with that change |
So I'm giving up for now. I've found out that the sendRequest to the LSP server for 'textDocument/definition' actually returns the correct result for the first call, but returns nil on every call afterward. If I throw out the @ericdallo So it seems the calls for 'codeLense' and so on that happen inside the jar produce a state inside LSP that makes it return null on 'textDocument/definition'. So I'm not sure anymore that the bug is in Calva. |
Last time I investigate I noticed the same! very odd indeed @Cyrik Hum, do you have client<->server logs showing that clojure-lsp is returning null? |
@ericdallo No, I see it when stopping in the debugger on calva itself. I still haven't found the client<->server logs for LSP, only the LSP log itself 😅 |
@ericdallo Is this issue related to this one: #1458? |
Oh, yes, sorry, I didn't find easily that issue before opening, feel free to close this one if you think it makes sense |
I closed the other, since this one has troubleshooting info already. |
Ok, so here are some messages between client and server when it works and when it doesn't work, which basically just confirms what @Cyrik said. I ran Go to Definition on
|
@ericdallo This does seem to be an issue in clojure-lsp. What Calva is sending to it seems fine, and is the same both when it works and doesn't work. 🤔 I don't know what could be going wrong in clojure-lsp, though. |
I really doubt it's a clojure-lsp issue as it works for other editors, but if we prove it is I'd be glad to fix it. Maybe calva is not using the |
Yes, see my comment above. I'm not sure what Calva can do about this if clojure-lsp sends nothing back, unless Calva is doing something before the request that could cause clojure-lsp to send nothing back, but I don't know what that could be. |
It feels to me like we are breaking LSP with the jar contents. Right after the jar opens we send:
There are a few messages in between that don't look too bad but at some point I get:
with a very, very long array of numbers. This would also be consistent with the observation that it's ok for the first call and breaks right after, always returning |
Sorry, I missed your comment. |
Good and bad news: The good news is that I found, the bad (for me) is that it's a clojure-lsp bug 😅
This makes clojure-lsp think that the file doesn't exists when receives a I'll try to make a fix on clojure-lsp side, but maybe we should understand why calva send the URI encoded like that, but not on other places @bpringe @Cyrik Edit: |
Fixed, it should be available on next clojure-lsp version, sorry for not noticing it before. LMK if any issues |
It's fine, I didn't like my sanity anyway 😇 |
I think the tricky part of that is that vscode send |
@ericdallo didClose sounds confusing, not sure why it's needed. But it does say to send the uri unless I'm misunderstanding your statement and that it's only meant as "hey, we aren't displaying this currently" message. |
Yes, you are correct, |
I think it's the vscode-languageclient library, or VS Code itself, sending the URIs encoded like that. I don't know the reasoning. |
I'll close this since the fix will be released in clojure-lsp soon, so we don't have to manually close this later. |
Using only LSP (no repl connected) It seems calva can't find the definition of external dependencies/jars even if clojure-lsp returns the correct response.
It's seems to me related with custom jar parsing code of calva
The text was updated successfully, but these errors were encountered: