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

VSCode Extension - Source Roots don't work in VSCode extension #598

Closed
Trass3r opened this issue Aug 12, 2024 · 5 comments
Closed

VSCode Extension - Source Roots don't work in VSCode extension #598

Trass3r opened this issue Aug 12, 2024 · 5 comments
Assignees
Labels

Comments

@Trass3r
Copy link

Trass3r commented Aug 12, 2024

It's a multi-root workspace fwiw. And the Java: List All Java Source Paths command lists all paths properly.
Yet it only calls VisualVM with the jdk root:

[info] [visualvm] Starting VisualVM
[info] [visualvm] Found defined installation path: c:\VisualVM
[info] [visualvm] VisualVM executable found in standard installation: c:\VisualVM\bin\visualvm.exe
[info] [visualvm] Found valid executable: c:\VisualVM\bin\visualvm.exe
[info] [visualvm] Found valid org-graalvm-visualvm-gotosource.jar: c:\VisualVM\visualvm\modules\org-graalvm-visualvm-gotosource.jar
[info] [jdk] Getting a JDK
[info] [jdk] Resolved path for setting netbeans.jdkhome: c:\GraalVM
[info] [jdk] Verified path for setting netbeans.jdkhome: c:\GraalVM
[info] [jdk] Getting a JDK
[info] [jdk] Resolved path for setting netbeans.jdkhome: c:\GraalVM
[info] [jdk] Verified path for setting netbeans.jdkhome: c:\GraalVM
[info] [visualvm] Command: c:\VisualVM\bin\visualvm.exe -J-XX:PerfMaxStringConstLength=10240 --jdkhome "c:\GraalVM" --source-viewer="%22C:\Users\...\AppData\Local\Programs\Microsoft%20VS%20Code\bin\code.cmd%22 -g {file}:{line}:{column}" --source-roots="c:\GraalVM\lib\src.zip[subpaths=*modules*]" --window-to-front

Any hints at how to find out what's wrong?

@jisedlac
Copy link
Member

Thank you for the bugreport! I've tried to reproduce the problem on my side, but without any success, works fine for me.

Please provide the following info so I can use a setup similar to yours:

  • What Java support extensions do you use (I assume it's the Extension Pack for Java)?
  • What other extensions do you have installed?
  • What GraalVM version do you have installed?

If possible, please provide a sample multi-root workspace which reproduces the problem (you can replace the actual code by just placeholder classes). I assume the problem is caused by an unexpected sources/workspace layout. Are the source roots configured correctly for just one folder opened (no multi-root)?

@Trass3r
Copy link
Author

Trass3r commented Aug 19, 2024

I've already tried to open one of the folders in the workspace on its own, but that didn't change anything.
Now I created a fresh vscode profile and set up the basics for testing. Extension Pack for Java, Spring stuff, VisualVM, GraalVM 17.0.12. Of course it worked.

Then I moved the code into a subfolder and it stopped working. So this should be the problem.
sourceRootsTest.zip

@jisedlac
Copy link
Member

Thank you for the test code! I'm now able to reproduce the problem. Obviously the solution is to open the actual project folder directly containing pom.xml.

I'll try to improve the current implementation to find the source roots in nested folders to be consistent with the VS Code Java support.

@Trass3r
Copy link
Author

Trass3r commented Aug 20, 2024

Thanks! Yeah Java: List All Java Source Paths finds the paths correctly in all cases.

@jisedlac jisedlac changed the title Source Roots don't work in VSCode extension VSCode Extension - Source Roots don't work in VSCode extension Sep 6, 2024
thurka pushed a commit that referenced this issue Sep 7, 2024
@jisedlac
Copy link
Member

jisedlac commented Sep 7, 2024

Fixed in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants