Skip to content

Direct navigation for single reference #3999

@Hendiaome

Description

@Hendiaome

Description:
When navigating to a method or variable that has only one reference, VSCode Java extension should directly navigate to the target location instead of showing the reference list.

Current behavior:

  • When using "Go to Definition" or "Find References" on a method/variable with single reference
  • VSCode shows a reference list with only one item
  • User needs to click on the reference to navigate

Expected behavior:

  • When using "Go to Definition" or "Find References" on a method/variable with single reference
  • VSCode should directly navigate to the target location
  • No reference list should be shown

Benefits:

  • Improves developer productivity
  • Reduces unnecessary clicks
  • Better user experience
  • Consistent with common IDE behavior

Example:

// Current behavior
public class Example {
    public void method() {
        singleReference(); // Go to Definition shows reference list
    }
    
    private void singleReference() {
        // implementation
    }
}

// Expected behavior
public class Example {
    public void method() {
        singleReference(); // Go to Definition directly navigates
    }
    
    private void singleReference() {
        // implementation
    }
}

Additional context:

  • This feature would be particularly useful in large codebases
  • It would make navigation more efficient
  • It's a common feature in other IDEs like IntelliJ IDEA

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions