Skip to content
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

Go To definition not working on dependencies #1421

Closed
joaomello opened this issue Dec 6, 2021 · 13 comments
Closed

Go To definition not working on dependencies #1421

joaomello opened this issue Dec 6, 2021 · 13 comments
Labels
bug Something isn't working code navigation

Comments

@joaomello
Copy link

Hi everyone!

When using go to definition Calva stops working when I'm inside a dependency.

nrepl: 0.8.3
cider-nrepl: 0.26.0
cider/piggieback: 0.5.2
clojure-lsp version configured: latest

clojure-lsp version used: 2021.12.01-12.28.16
clj-kondo version used: 2021.10.20-SNAPSHOT

@ericdallo
Copy link
Contributor

The same happens with me with Calva but not with Emacs (lsp-mode), so I don't think it's a clojure-lsp issue.
To repro, find a definition of a symbol in your project that goes to a jar/dependency, then try to find again any definition inside that dependency and it won't work
Any clues if calva should do anything special for that @bpringe ?

@bpringe bpringe added code navigation bug Something isn't working labels Dec 8, 2021
@bpringe
Copy link
Member

bpringe commented Dec 8, 2021

Let me make sure I'm understanding the issue correctly. If I go to definition on println then I'm taken to its definition in clojure.core, but then if I go to definition again on apply inside of println, I get a tooltip message: "No definition found for 'apply'".

Is that the issue ^?

This is without a connected repl, so the definitions should be provided via clojure-lsp, but when I go to definition from within clojure.core, no LSP messages are sent.

@bpringe
Copy link
Member

bpringe commented Dec 8, 2021

I also verified with a breakpoint that the provideDefinition middleware is not run when I go to definition from within clojure.core.

If LSP should be providing this support, maybe we need to change/set some initialization setting...

@bpringe bpringe added this to To do in Brandon's Board via automation Dec 8, 2021
@ericdallo
Copy link
Contributor

Yes @bpringe, that's the issue.
I'm not sure why this happens, I'm not aware of anything we should do on clojure-lsp side as this always worked for emacs for example

@viebel
Copy link

viebel commented Dec 9, 2021

The exact same issue happens on neovim.

@ericdallo
Copy link
Contributor

I'll try to debug that on calva myself soon to check what calva is sending/receiving when inside a jar/dependency

@yyoncho
Copy link

yyoncho commented Dec 9, 2021

you should do that: https://github.com/redhat-developer/vscode-java/blob/9f32875a67352487f5c414bb7fef04c9b00af89d/src/providerDispatcher.ts#L28 (or similar)

@ericdallo
Copy link
Contributor

Thank you @yyoncho!
@bpringe that's makes sense ☝🏻, we did that for emacs, probably need to be implemented on vscode and vim as well @viebel

@rafaeldelboni
Copy link

@viebel since nvim 0.6 is using v32 of pi_zip I'm being able to enter in dependencies via go to definition, what version you using?

@ericdallo
Copy link
Contributor

#1431 should fix this issue

@viebel
Copy link

viebel commented Dec 10, 2021

@rafaeldelboni I am also able to enter in dependencies via "go to definition". But when I am inside a dependency "go to definition" doesn't work.
I am using nvim v0.7.0-dev on ubuntu. Full details below:

NVIM v0.7.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-oWQAWf/neovim-0.6.0~ubuntu1+git2021120
61251-523f03b50-adeb5640f=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE
 -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-pa
rameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthroug
h -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS
-D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/neovim-oW
QAWf/neovim-0.6.0~ubuntu1+git202112061251-523f03b50-adeb5640f/build/config -I/build/neovim-oWQAWf/neovi
m-0.6.0~ubuntu1+git202112061251-523f03b50-adeb5640f/src -I/build/neovim-oWQAWf/neovim-0.6.0~ubuntu1+git
202112061251-523f03b50-adeb5640f/.deps/usr/include -I/usr/include -I/build/neovim-oWQAWf/neovim-0.6.0~u
buntu1+git202112061251-523f03b50-adeb5640f/build/src/nvim/auto -I/build/neovim-oWQAWf/neovim-0.6.0~ubun
tu1+git202112061251-523f03b50-adeb5640f/build/include
Compiled by buildd@lgw01-amd64-048

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

@viebel
Copy link

viebel commented Dec 10, 2021

@ericdallo Do you know what should be done on nvim to fix this issue?

@ericdallo
Copy link
Contributor

@viebel if not working, I suspect the same need to be done on nvim, telling nvim do add the jar opened file to the same active lsp workspace

Brandon's Board automation moved this from To do to Done Dec 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code navigation
Projects
Development

No branches or pull requests

6 participants