-
Notifications
You must be signed in to change notification settings - Fork 317
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
Files in sources jars with extra parent directories are not found #3815
Comments
kpodsiad
added
the
bug
Something that is making a piece of functionality unusable
label
Apr 13, 2022
It can be reproduced when JAVA_HOME is on Java 17 too. |
Closed
dos65
added a commit
to dos65/metals
that referenced
this issue
Feb 23, 2023
Implements a lighter version of java parser for extracting toplevel definitions as we do in Scala Should fix scalameta#3815
dos65
added a commit
to dos65/metals
that referenced
this issue
Feb 23, 2023
Implements a lighter version of java parser for extracting toplevel definitions as we do in Scala Should fix scalameta#3815
dos65
added a commit
to dos65/metals
that referenced
this issue
Feb 23, 2023
Implements a lighter version of java parser for extracting toplevel definitions as we do in Scala Should fix scalameta#3815
dos65
added a commit
to dos65/metals
that referenced
this issue
Feb 24, 2023
Implements a lighter version of java parser for extracting toplevel definitions as we do in Scala Should fix scalameta#3815
dos65
added a commit
to dos65/metals
that referenced
this issue
Feb 24, 2023
Implements a lighter version of java parser for extracting toplevel definitions as we do in Scala Should fix scalameta#3815
tgodzik
pushed a commit
that referenced
this issue
Apr 17, 2023
Implements a lighter version of java parser for extracting toplevel definitions as we do in Scala Should fix #3815
Just a note, I'm still reproducing this with the project attached above with Metals 0.11.2 which should include #5009. (Java 11 and 18 tried.) |
We need to take another look then, thanks for letting us know! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Issue description
When working with Scala in VS Code, Metals will download sources jars and support dereferencing classes from them in code files by the "Go to definition" context menu option. However if said source jars contain extra parent directories, e.g. source files are under
src/main/java/com/...
in the jar instead ofcom/...
then this silently fails and you get "No definition found". The "Language Support for Java by Red Hat" on the other hand correctly finds the source files and allows dereferencing. The attached project demonstrates this for the bindings-rxjava and bindings-java jars which respectively have single and multiple buried roots.Reproduction steps
src-jar-test.zip
and load the resultingsrc-jar-test
directory into VS CodeDamlLedgerClient
(single-buried-root) andTransactionFilter
(multiple roots) results in Javadoc and/or source previews, and Ctrl/Cmd-clicking goes to the source.src-jar-test.zip
Expected behavior
I have not found anything in the Jar file specification specifically addressing this point, but in practice the Java plugins for VS Code and IntelliJ both find the sources despite the extra parent directories, and I expected Metals to do so as well.
Operating system
macOS
Editor/Extension
VS Code
Version of Metals
v0.11.2
Extra context or search terms
No response
The text was updated successfully, but these errors were encountered: