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

call hierarchy does not find callers (but it should) #2219

Open
clembo590 opened this issue Nov 17, 2021 · 4 comments
Open

call hierarchy does not find callers (but it should) #2219

clembo590 opened this issue Nov 17, 2021 · 4 comments

Comments

@clembo590
Copy link

clembo590 commented Nov 17, 2021

Environment
  • Operating System: macos 12.0.1
  • JDK version: 11
  • Visual Studio Code version: 1.62.2
  • Java extension version: java extension pack v0.18.6
Steps To Reproduce

I have created a public repo so that the issue is easily reproducible:

step1: clone this repo:

git clone https://github.com/clembo590/issues.git --branch vscode-java/issues/2219

step2: run mvn clean install

step 3: "import the project in vscode"
open MyCustomizer.java and select the method called customize
make a right click and select Show call hierarchy
Vscode should (and do) find a method (see screenshot)

Screenshot 2021-11-17 at 14 23 36

step 4: open pom.xml and uncomment the dependency:
Screenshot 2021-11-17 at 14 34 06

step 5:
open MyCustomizer.java and select the method called customize
make a right click and select Show call hierarchy
--> VSCODE does not find any calls to this method: that is an error! vscode should find the same call hierarchy as on step 3 (IntelliJ shows correctly the call hierarchy)

@clembo590
Copy link
Author

Hello.... Anyone working on this ?

@rgrunber
Copy link
Member

Thanks for the example. I'm able to reproduce this with VS Code and with Eclipse as well, so could be an issue with JDT. Likely an upstream issue.

I tried a simple example to confirm that calling some interface's method, should result in all implementations showing the implemented method as having been referenced once (or have an entry pointing to the usage in the call hierarchy).

@clembo590
Copy link
Author

@rgrunber any update on solving this issue ?

@snjeza
Copy link
Contributor

snjeza commented Jan 30, 2023

The guava library includes the $EnumUtils class that breaks the Call Hierrachy action. The class contains a reference to a potential customize method.
I have created eclipse-jdt/eclipse.jdt.core#670
A workaround:

  • add guava to the root pom directly

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

No branches or pull requests

4 participants