You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hover on one of the java class in the clojure file and xref-find-definitons on it
in the minimal emacs eglot+clojure-lsp setup(./emacs-bad/init.el), eglot-extend-to-xref is set to t
when jumped to java source, you can see eglot enabled on the destination java file even though I've got nothing setup for java lsp and with no eglot-ensure on java-mode.
I'd expect eglot-extend-to-xref shoud only work (as extend) for whatever mode I've setup for. In this case, I've only setup a hook for clojure-lsp with clojure-mode on eglot-ensure for example. But as long as I enabled eglot-extend-to-xref and jump definiton from the clojure source file to java source file, eglot is enabled(extended) to this java source file.
But that's unexpected and not desired this case: a. Because I don't have any java lsp installed and setup b. clojure-lsp won't work on java source file.
Better document why eglot-extend-to-xref would extend on unsetup mode or just let eglot-extend-to-xref extend itself to some new mode(from clojure mode to java mode this case) behave same as it'd prompt you to install java lsp as if you just open a fresh java file without setup lsp/eglot this case.
I think I get it, no need to reproduce (recipes based on nix are fairly useless to me anyway).
This is unusual though, as most servers link to files in the same language. I guess some extra checks for the eglot-extend-to-xref behavior can be added.
joaotavora
changed the title
eglot-extend-to-xref unexpected bahavior
eglot-extend-to-xref shouldn't activate Eglot in files other than the managed modes
Aug 20, 2023
https://github.com/sg-qwt/debuglsp
nix develop
to start a devshellemacs-bad
inside that devshellI'd expect eglot-extend-to-xref shoud only work (as extend) for whatever mode I've setup for. In this case, I've only setup a hook for clojure-lsp with clojure-mode on eglot-ensure for example. But as long as I enabled
eglot-extend-to-xref
and jump definiton from the clojure source file to java source file, eglot is enabled(extended) to this java source file.But that's unexpected and not desired this case: a. Because I don't have any java lsp installed and setup b. clojure-lsp won't work on java source file.
Better document why eglot-extend-to-xref would extend on unsetup mode or just let eglot-extend-to-xref extend itself to some new mode(from clojure mode to java mode this case) behave same as it'd prompt you to install java lsp as if you just open a fresh java file without setup lsp/eglot this case.
cross ref: clojure-lsp/clojure-lsp#1656
The text was updated successfully, but these errors were encountered: