Mayank Patel
Mayank Patel

Reputation: 8536

IntelliJ IDEA: Jump from interface to implementing method in Go

In IntilliJ Idea/Goland, Is there any shortcut that would allow me to select a method inside interface definition and jump to implementation of that method or give me list of implementations.

I am looking for something like what I get when Cmd+Click and get usage of the methods/function.

View After Cmd+Click

But instead of usage of method I need short cut for implementation. Currently I have to copy the method name and search in the project, which does not feels like most efficient way.

I am using intelliJ Idea (Community Edition) 2016.2.2 EAP with Go plugin Version: 0.12.1724.

I have tried Cmd+Alt+b but always getting No implementation found

Upvotes: 9

Views: 6121

Answers (5)

Md. Ishtiaq Islam
Md. Ishtiaq Islam

Reputation: 11

For GoLand you can follow the available keyboard shortcuts which is provided in the GoLand official documentation. It is possible to jump to the method implementations using Ctrl + Alt + B (windows/linux).

Same command also works for Intellij IDEA. You can find all available keyboard shortcuts here.

Upvotes: 1

Michal K
Michal K

Reputation: 135

it depends on the keymap settings, if you use Visual Studio keymap like me, the shortcuts will be a bit different: Options+End on Mac does the thing (GoLand 2022.2). IntelliJ keymap is Options+Cmd+B.

enter image description here

You can find your shortcut by searching action Go to implementation, see: enter image description here

Upvotes: 1

Mayank Patel
Mayank Patel

Reputation: 8536

This support has been added in Goland (or with go plugin in IntelliJ ultimate) now. Shortcut for the same is Alt+Cmd+B (Option+Cmd+B for Mac).

enter image description here

Upvotes: 20

Lifei Chen
Lifei Chen

Reputation: 605

For goland

Windows: Alt+Cmd+B Mac os: Option+Cmd+B

Upvotes: 2

Simone Carletti
Simone Carletti

Reputation: 176372

No, such shortcut doesn't exist.

You can use "Find Usage" to determine where the specific interface method is used, but if you want to see all the concrete implementations the current way is to search the entire project for the method name.

Upvotes: 1

Related Questions