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.


Solution 1:

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

Solution 2:

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

Solution 3:

In the structure panel select the "Autoscroll from source" option. This way when you place the cursor inside any method the structure panel will show which method you're in.

Solution 4:

Intellij now has support for breadcrumbs. Go to settings > appearance and tick "Show breadcrumbs". In this way you can view class/method name without Alt+Q.