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

Critical: reference search doesn't work for fields in JDK classes #2405

Closed
gayanper opened this issue Jan 16, 2023 · 17 comments · Fixed by #2413
Closed

Critical: reference search doesn't work for fields in JDK classes #2405

gayanper opened this issue Jan 16, 2023 · 17 comments · Fixed by #2413
Assignees
Labels

Comments

@gayanper
Copy link
Contributor

Find reference for System.out after open java.lang.System class in vscode java. No references are shown

But take com.google.common.collect.MultimapBuilder and search for any field or constant. The reference works.

This issue cannot be reproduced in upstream JDT project.

@gayanper gayanper changed the title Critical: reference search doesn't work for fields in Critical: reference search doesn't work for fields in JDK classes Jan 16, 2023
@snjeza
Copy link
Contributor

snjeza commented Jan 16, 2023

@gayanper I can't reproduce the issue. Could you provide a project example reproducing the error?

@gayanper
Copy link
Contributor Author

@snjeza i was browsing spring-cloud sleuth project using java17 as the project jdt in settings

@gayanper
Copy link
Contributor Author

And i have the java decompiler vscode plugin installed as well.

@snjeza
Copy link
Contributor

snjeza commented Jan 16, 2023

Spring Cloud Sleuth ?

@snjeza
Copy link
Contributor

snjeza commented Jan 16, 2023

@gayanper I still can't reproduce the issue.
My steps

  • install dgileadi.java-decompiler
  • import Spring Cloud Sleuth
  • open System.out
  • Run Find All References

Result: 139 results in 59 files

@gayanper
Copy link
Contributor Author

I think I was wrong System.out works because its not final. But if you try ForkJoinPool.SWIDTH the reference are empty. But in upstream JDT values are shown.

@gayanper
Copy link
Contributor Author

Seems fields such phase in the inner class doesn't show up as well in vscode java

@snjeza
Copy link
Contributor

snjeza commented Jan 17, 2023

@gayanper Could you try VS Code 1.15.1 ?

@gayanper
Copy link
Contributor Author

I couldn't find the download file and tring building locally, But the ls build fails

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-director-plugin:3.0.1:materialize-products (create-distributions) on project org.eclipse.jdt.ls.product: Installation of product languageServer.product for environment linux/gtk/x86_64 failed: Call to p2 director application failed with exit code 13. Program arguments were: [-metadataRepository

May be something to do with target file updates.

@snjeza
Copy link
Contributor

snjeza commented Jan 17, 2023

I couldn't find the download file and tring building locally, But the ls build fails

It is a VS Code vsix file. You should download it and install as an extension:

$ wget https://github.com/snjeza/vscode-test/raw/master/java-1.15.1.vsix
code --install-extension java-1.15.1.vsix

See Install From vsix

@gayanper
Copy link
Contributor Author

@snjeza No the forkjoinpool example I mentioned doesn't work

@snjeza
Copy link
Contributor

snjeza commented Jan 18, 2023

@gayanper Could you, please, show me what you expect?

forkjoinpool

@gayanper
Copy link
Contributor Author

I don't get any results when I run the Find All Reference action. I'm on MacOS running Microsoft JDK 17.0.5. I ran both release version and the master without no help of finding reference. Unfortunatly until the jdt.ls build is fixed to run on MacOS aarch64 I cannot debug to see whats wrong.

@snjeza
Copy link
Contributor

snjeza commented Jan 19, 2023

@gayanper
Copy link
Contributor Author

@snjeza i ran with the vscode-java source with latest jdt.ls build from the eclipse download site. Is there any difference between that setup and your build ?

@snjeza
Copy link
Contributor

snjeza commented Jan 19, 2023

@gayanper Yes, there is a difference. I have tried to fix this issue.

@gayanper
Copy link
Contributor Author

Yes it works.

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

Successfully merging a pull request may close this issue.

3 participants