Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Display Current Function in Eclipse

I'm using the "Toggle Breadcrumb" option from toolbar:

Eclipse Breadcrumb button

It shows a nice breadcrumb, ending with current function name.

It's quite handy for me, as Outline becomes cumbersome to use if you have zilions of functions.

It produces the following structure above your Java Editor (truncated at the picture below):

Eclipse Breadcrumb path


The "Outline" view shows the current function.

enter image description here

It may be necessary to enable the 'Link to Editor' option in the Outline View dropdown menu. This might be off by default for CDT.


I was looking for something similar (Xcode-like bar at the top showing the current function, where you can also go to another function by clicking on it to open a popup list of functions). Here is what I settled on with Eclipse 3.5.1 CDT:

I moved the Outline view to the top, resized it to make it a 1-line horizontal strip (don't make it too narrow), and selected "Link With Editor" in its menu, so that it always shows the current function. However, this doesn't open a popup list like Xcode. For that functionality, I assigned a shortcut to the "Show Outline" command which does open a popup list of all functions.


The Eclipse function 'show outline' will pop up a list of outline objects, and it will highlight the object your cursor is inside in grey. It's typically bound to 'ctrl-o' (the letter 'o', not zero), but you can re-bind it as you see fit. I'm running Eclipse with the CDT plugin and it works pretty well for me.


To enable the breadcrumb invoke Toggle Java Editor Breadcrumb in the toolbar or press Alt+Shift+B in the Java editor.


You can also display the Quick Outline (ctrl+o). This way you see the context quickly without having to have a permanent Outline Window linked to the Editor.


Use the "Link With Editor" option on the outline menu