Vscode-java: Is there a way to show type hierarchy or navigate to implementations of an interface?

Created on 29 Jun 2017  路  3Comments  路  Source: redhat-developer/vscode-java

I'm trying to find a way to navigate to implementations of an method defined in an interface. When I command click, it only takes me to the declaration of the method.

Environment
  • Operating System: OSX
  • JDK version: 1.8
  • Visual Studio Code version: 1.13.1
  • Java extension version: 0.6.0
Steps To Reproduce
  1. command click on a method in a piece of java code. The method is declared in an interface and has one or more implementations.
    Current Result

The user is navigated to the method declaration in the interface.

Expected Result

The user is navigated to the method implementation if there is only 1, or is presented with a list of implementations to choose from. After choosing an implementation, the user is navigated to that implementation.

Additional Informations
enhancement

Most helpful comment

@bkbonner you can test implementor code lenses with the latest CI build: download the most recent java-<version>.vsix file and install it by following the instructions here.

You need to set java.implementationsCodeLens.enabled to true in vscode settings.

All 3 comments

Closest thing we have right now is the find all references (Click on references link or Shift+F12).

There's an enhancement request for the Java Language Server to provide Interface implementors, see https://github.com/eclipse/eclipse.jdt.ls/issues/99.

But I reckon ctrl+click on a method to jump to implementors would be a nice feature to have

Thanks for including the link to that request @fbricon.

@bkbonner you can test implementor code lenses with the latest CI build: download the most recent java-<version>.vsix file and install it by following the instructions here.

You need to set java.implementationsCodeLens.enabled to true in vscode settings.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shawmanz32na picture shawmanz32na  路  3Comments

protoEvangelion picture protoEvangelion  路  3Comments

zalcorshark picture zalcorshark  路  3Comments

BuZZ-dEE picture BuZZ-dEE  路  4Comments

sfariaNG picture sfariaNG  路  3Comments