Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way in Intellij IDEA to see the name of the method the current line belongs to?

In our code base there are a few very long methods (several pages worth of code). When reading the code, it would sometimes be good to be able to see the name of the method the current line belongs to, without paging up to the beginning of the method. Is this possible in Intellij IDEA? I am using Intellij IDEA 7.0.3.

like image 431
Henrik Warne Avatar asked Dec 17 '09 09:12

Henrik Warne


People also ask

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).

How do I find the method call hierarchy in IntelliJ?

From the main menu, select Navigate | Method Hierarchy or press Ctrl+Shift+H .

How do I navigate methods in IntelliJ?

To navigate backwards, press Ctrl+Alt+Left . To navigate forward, press Ctrl+Alt+Right . To navigate to the last edited location, press Ctrl+Shift+Backspace . To find the current caret location in the editor, press Ctrl+M .

How do you see the documentation for any class or method in IntelliJ?

View Javadocs in the editorHover the mouse over the necessary symbol in the editor. Place the caret at the symbol and press Ctrl+Q (View | Quick Documentation). Press Ctrl+Q again to open this documentation in the Documentation tool window.


2 Answers

You can use View | Context Info (Alt+Q, Ctrl+Shift+Q on Macs). It will display a pop-up on the top of the editor with the current context information (class/method signature).

like image 57
CrazyCoder Avatar answered Sep 19 '22 19:09

CrazyCoder


IntelliJ 2018

This is shown by default at the bottom.

Unfortunately, the method is shown only by name (not including the parameters). If a method is overloaded you won't know for sure where you are.

Method breadcrumbs below code area

If you want to move it from bottom to top, go to File > Settings... > Editor > General > Breadcrumbs > check Top:

Editor > Breadcrumbs > Show breadcrumbs

like image 27
ROMANIA_engineer Avatar answered Sep 19 '22 19:09

ROMANIA_engineer