Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find a method where used in intellij

Is there a way to find one method where used in intellij idea with golang plugin ?

I need to find the method all where used.

Anyone who know how to do this?

like image 540
sope Avatar asked Dec 04 '15 07:12

sope


People also ask

How do I view methods in IntelliJ?

By default, IntelliJ IDEA shows all classes, methods, and other elements of the current file. To toggle the elements you want to show, click the corresponding buttons on the Structure tool window toolbar.

How do I navigate methods in IntelliJ?

Browse through methodsPress Alt+Down or Alt+Up . To visually separate methods in code, in the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | General | Appearance and select the Show method separators option. To open the Structure tool window, press Alt+7 .

How do I view history in IntelliJ?

Right-click anywhere in the editor and choose Local History | Show History from the context menu. In the dialog that opens, the left-hand pane shows a list of all saved revisions of the current file with timestamps.

How do I get method definition in IntelliJ?

In IntelliJ IDEA, you can see where and how symbols, such as tags, classes, fields, methods, or functions are defined in your project. For this purpose, the IDE features the Quick Definition popup. To view definition of a symbol, select it in the editor and press Ctrl+Shift+I (or click View | Quick Definition).


2 Answers

Find Usages is for sure the right way how it was already mentioned. However, if you don't want going through the context menu, you could also use the shortcut Alt + F7 for Windows/Linux or Option + F7 for Mac OS. You can also specify the Find Usages Scope which can be, for example, only production files or only test classes. Other shortcuts could be found from here.

Unfortunately if you use Ubuntu this shortcut is already reserved for some system operation and to make it working in Intellij IDEA you need to disable it in OS level.

like image 147
Rufi Avatar answered Oct 03 '22 00:10

Rufi


Right click on the method name and select "Find Usages". This will find direct callers of the concrete method. If you want to find callers who call the method via an interface, it's harder. If you know the interface(s), you can navigate to each of them in turn and right click on the method name and select "Find Usages". If you don't know which interfaces include the method, Go Oracle can help.

like image 36
glyn Avatar answered Oct 02 '22 23:10

glyn