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

It seems "# Go to Symbol" in Workspace not able to search for Java Methods or Classes #3766

Closed
alexandertsukanov opened this issue Sep 18, 2024 · 3 comments

Comments

@alexandertsukanov
Copy link

Hey everyone, it seems that I'm unable to find any Java methods, symbols, or classes when I use the "# symbol command". My expectation is that when I type or search in this manner, I should see the corresponding methods and relevant classes, etc. However, that is not happening.

Environment
  • Operating System: macOS 14.16.1
  • JDK version: 17
  • Visual Studio Code version: 1.91.1
  • Java extension version: 1.34.0 (August 29th, 2024)
Steps To Reproduce
  1. Open any Java project
  2. Wait until indexing will finish
  3. Try to search for some method or symbol
@rgrunber
Copy link
Member

You would be able to search for any class in the classpath, but currently only methods declared in the project itself (not libraries), assuming "java.symbols.includeSourceMethodDeclarations": true. I just tried it out with 1.93.1 & 1.91.1, on vscode-java 1.34.0, and it seems to be working.

Does the project import successfully without errors ? You should see that the language server is in the ready state in the bottom left corner.

image

If you open a Java source file, you should see that a JDK has been configured, based on the project's build settings :

image

@alexandertsukanov
Copy link
Author

Hey, @rgrunber !
Thank you very much for your support. It seems the option you provided has worked for me:
"java.symbols.includeSourceMethodDeclarations": true
Thanks!

@rgrunber
Copy link
Member

For reference, if you wanted to look through all method declarations, even from dependencies of the project, this is a feature I definitely want to have adopted (See eclipse-jdtls/eclipse.jdt.ls#1712 ). It's just that we need a particular feature (partial search) so it won't be too slow on larger projects.

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

No branches or pull requests

2 participants