redhat-developer / redhat-developer/vscode-java

Call Hierarchy searches wrong variable

Open
#2,491 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug navigation
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

If multipe variables are declared in one line, Peek>Call Hierachry will look for first Variable decalred in that line

Environment
  • Operating System: fedora 36
  • JDK version: 17
  • Visual Studio Code version: latest
  • Java extension version: 1.7.0
Steps To Reproduce
  1. declare mutiple variables in one line
  2. right click the second one
  3. Peek>Call Hierarchy

Test yourself:

  public class test {
      public static void main(String[] args) {
          int x = 1,y=1;
  
          Boolean h = y == 1;
          y = 0;
  
  
  
  
  
  
  
  
          h = x==1;
          x = 0 
      }
  }

while looking for Call Hirachy of y x++; is highlighted

y++; -> Highlighted

in my Projekt:
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in VS Code using the provided Java example with multiple variables declared on one line, then invoke Peek > Call Hierarchy on the second variable. Trace the Call Hierarchy handling for that selection and compare the resolved variable with the highlighted result. Done means selecting y or x resolves and highlights the corresponding variable rather than the first declaration on the line.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.