You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. Im new to vscode and java extension. I wanna see all implementation of target interface, like in jetbrains idea (crtl+alt+b). I setted up ctrl+alt+b for command java.show.implementations, but it always fail. IMHO thats strange becase implementationsCodeLens works fine. Any help?
Thanks.
Environment
Operating System: fedora 27
JDK version: 1.8.0.161
Visual Studio Code version: 1.20.1
Java extension version: 0.19.0
Additional Informations
Reacted by LQR86, Julien Greffe, Kevin Shaw, Leobardo Mora, Felipe Saab, Erik Aaron Hansen, Hordur Freyr Yngvason, Matti, Sebastian Schlatow, Renato Souto and 18 more
The current java.show.implementations command is actually internal, not designed to be called manually from the UI, or be bound to a shortcut.
However, VSCode now has a show implementation shortcut (Ctrl+F12) (see microsoft/vscode#18346), so we should eventually be able to plug into that mechanism, but it's not been standardized yet.
Also, it seems that "Go to super definition(or go to super method)" command doesn't exist in VSCode. And I really need it when navigating through Java or any other object-oriented code. Sigh.
Reacted by Renato Souto, Timothy Lombrana, Paul Sharoon, Rana Ahmed and orchief
BTW the find implementors behavior in VSCode is a bit weird, always opens the 1st result then displays the list under that result: microsoft/vscode#55603
I tested this and pressing Esc when Goto Implementation is executed doesn't cancel the request. Please file an issue against VS Code itself so cancelation can be implemented there.
For the rest, the feature seems to work as expected.
Please note that java.lang.Object is treated as a special case. Since it will always return a huge list of results, precise location is disabled. Results will always point to Line 1, Char 1, so as to avoid opening thousands of files to compute the actual type location.
I just tried this, installed java-0.31.0-1204.vsix
But it does not work for me hitting cmd+12 (Mac) or selecting "Go to implementation" from the menu both shows "No implementation found for: "
But "Go to definition" works and takes me to the interface and my implementation class is right next to it in the same folder.
Must I do something to enable this feature?
Okay, I figured out how this works.
But IMO it can be improved.
If you are placed on method call to an interface and select "Go to implementation" it will show you "No implementation found...", what you need to do is first select "Go to Definition" which navigates to the method definition in the interface and here you can select "Go to implementation" which correctly navigates to the implementation.
I had hoped this was a one step process, usually I do not care about the definition, and it opens an extra file in my workspace.
But it is still nice to be able to do it at all :-)
Reacted by Xi Kangjie, Evgeni Atanasov, dlicois, Joel, Domenic Datti, Ricardo Cardona Ramirez, Reeshabh Choudhary, Guixing Bai, feefk, IX and 1 more
yes, in VSCode, " Go to Definition" first and then "Go to implementation" works fine.
But i'm using coc.nvim in neovim, everytime i open a java project, "Go to Definition" works fine, but "Go to implementation" doesn't work at first time, after i call it serveral times, it begin works and works fine after that. i don't know why. i have installed the latest snapshot of jdt.ls
Activity
fbricon commentedon Feb 16, 2018
The current
java.show.implementationscommand is actually internal, not designed to be called manually from the UI, or be bound to a shortcut.However, VSCode now has a show implementation shortcut (Ctrl+F12) (see microsoft/vscode#18346), so we should eventually be able to plug into that mechanism, but it's not been standardized yet.
[-]java.show.implementations always fails[/-][+]Add support for "Go to implementation"[/+]LQR86 commentedon Mar 2, 2018
Also, it seems that "Go to super definition(or go to super method)" command doesn't exist in VSCode. And I really need it when navigating through Java or any other object-oriented code. Sigh.
shawmanz32na commentedon Mar 7, 2018
@fbricon Unless I'm misreading, both the dependency issues you listed are now merged/closed. Can this get put on the queue of things to do?
I'd love to be able to quickly navigate to implementing classes.
darkgem666 commentedon Mar 8, 2018
It looks the new update for VSCode has now the implementation for this, can we please make this happen?
kainazzzo commentedon Jun 7, 2018
I would also like this feature a lot. I've switched to VS code for all my java projects but miss this feature mostly.
aabuniaj commentedon Aug 2, 2018
Any updates on this functionality?
fbricon commentedon Aug 2, 2018
I'm working on it. It should be available in a CI build next week and should be generally available for the end of August release
aabuniaj commentedon Aug 2, 2018
Thank you! I appreciate the update.
fbricon commentedon Aug 2, 2018
BTW the find implementors behavior in VSCode is a bit weird, always opens the 1st result then displays the list under that result: microsoft/vscode#55603
fbricon commentedon Aug 2, 2018
@jrieken I can't seem to be able to cancel textDocument/implementation queries. Is it me or a limitation in vscode?
2 remaining items
fbricon commentedon Aug 6, 2018
@aeschli indeed I don't see any cancellation event when hitting
escwhile implementation search is runningdbaeumer commentedon Aug 15, 2018
This is implemented generically as soon as a request provides a cancelation token.
dbaeumer commentedon Aug 15, 2018
I tested this and pressing Esc when Goto Implementation is executed doesn't cancel the request. Please file an issue against VS Code itself so cancelation can be implemented there.
fbricon commentedon Aug 29, 2018
Opened microsoft/vscode#57537 for the cancellation issue.
The issue with the 1st result being opened is now microsoft/vscode#31046
For the rest, the feature seems to work as expected.
Please note that java.lang.Object is treated as a special case. Since it will always return a huge list of results, precise location is disabled. Results will always point to Line 1, Char 1, so as to avoid opening thousands of files to compute the actual type location.
aabuniaj commentedon Aug 30, 2018
Is this feature available to try? How can I get it to test it out?
fbricon commentedon Aug 30, 2018
@aabuniaj you can download and install the latest java-*.vsix build from http://download.jboss.org/jbosstools/jdt.ls/staging/?C=M;O=D
amplexdenmark commentedon Sep 14, 2018
I just tried this, installed java-0.31.0-1204.vsix
But it does not work for me hitting cmd+12 (Mac) or selecting "Go to implementation" from the menu both shows "No implementation found for: "
But "Go to definition" works and takes me to the interface and my implementation class is right next to it in the same folder.
Must I do something to enable this feature?
JavaHello commentedon Sep 14, 2018
I am very happy that this feature is ready to use.
amplexdenmark commentedon Sep 20, 2018
Okay, I figured out how this works.
But IMO it can be improved.
If you are placed on method call to an interface and select "Go to implementation" it will show you "No implementation found...", what you need to do is first select "Go to Definition" which navigates to the method definition in the interface and here you can select "Go to implementation" which correctly navigates to the implementation.
I had hoped this was a one step process, usually I do not care about the definition, and it opens an extra file in my workspace.
But it is still nice to be able to do it at all :-)
finviman commentedon Mar 18, 2019
yes, in VSCode, " Go to Definition" first and then "Go to implementation" works fine.
But i'm using coc.nvim in neovim, everytime i open a java project, "Go to Definition" works fine, but "Go to implementation" doesn't work at first time, after i call it serveral times, it begin works and works fine after that. i don't know why. i have installed the latest snapshot of jdt.ls
liudonghua123 commentedon Jun 13, 2019
It's nice to have this features.
openvita commentedon Oct 28, 2019
Would be nice to have this feature. VSCode for Java rocks !
fbricon commentedon Oct 28, 2019
@openvita see keymapping in vscode:

meydominic commentedon Nov 6, 2019
I'm on version 0.52 but it's not working:
