clojure-lsp icon indicating copy to clipboard operation
clojure-lsp copied to clipboard

LSP does not function inside dependencies

Open SuperCuber opened this issue 2 years ago • 3 comments

Describe the bug Using lein and nvim. Let's say I have a function that is defined in a library. If I "go to definition" on it, I as expected see the definition of that function in a path like zipfile://~/.m2/repository/dependency/...dependency.jar::namespace/foo/bar/file.clj

However it looks like the lsp client does not attach to that buffer, and no LSP features work for it - so I cannot for example keep "going to definition" on functions inside that file, forcing me to clone and explore that project in a separate session.

To Reproduce Steps to reproduce the behavior:

  1. Open a namespace in a lein project that imports a namespace from maven
  2. Go to definition to that dependency
  3. LSP does not attach

Expected behavior I would expect the LSP to attach to that buffer and allow further exploration

Logs - N/A

User details (please complete the following information):

  • OS: MacOS
  • Editor: NVIM v0.8.3
  • Version: clojure-lsp 2023.01.26-11.14.00-nightly, clj-kondo 2023.01.20

Additional context N/A

SuperCuber avatar Feb 12 '23 08:02 SuperCuber

That's is probably a issue in your nvim configuration as there are vim users and that feature works properly, I doubt it's a bug in the server, to confirm that you can get the client <-> server logs and probably the server will be sending correctly the info if you have a classpath correctly configured

ericdallo avatar Feb 12 '23 16:02 ericdallo

According to this filename->uri returns paths with the form like zipfile:///C:/whateveer/some.jar::path_to_clj.clj. Pi_zip documentation states that file paths should be zipfile://C:/whatever/som.jar::path_to_clj.clj.

This is the problem in my case, where neovim can't open core.clj, because of triple slashes.

cryogenian avatar Jan 12 '24 02:01 cryogenian

That's weird, triple slashes work for everything else, we had lots of issues in the past with single and 2 slashes and 3 slash was the way to fix all issues (until this one)

ericdallo avatar Feb 04 '24 21:02 ericdallo