tags:

views:

614

answers:

4

I miss a certain functionality in Eclipse. I would like to know the name of the current function the cursor is currently inside. This is useful when browsing unknown code using the search function, for example.

Any idea how to show it? Maybe a plugin?

+4  A: 
Pascal Thivent
maybe this is different for Java development in Eclipse (I use Eclipse+CDT for C development), but the outline view doesn't tell you what function your cursor is in - it just lists all objects, and provides hyperlinking. This question is specifically about how to tell where you are "right now"...
dls
@dis Thank you for your enlightening comment but I actually perfectly understood that the question is about telling the user where he is "right now". To my knowledge, this is one of the features of the outline view in Java, Ruby, Lisp... And when I look at this article http://www.ibm.com/developerworks/opensource/library/os-ecc/, it seems to apply to C/C++ development too. BTW, did you see somewhere that the OP was doing C development? I didn't.
Pascal Thivent
@Pascal: Fair comment about C development. However, the reference article contains two sentences about Outline View in the CDT and neither of them describe the behavior this gentleman was after. Couple that with the fact that the Eclipse/CDT installation I'm currently using does not exhibit this behavior and it becomes perfectly reasonable for me to make the comment I did. Also, please be conscious of the tenor of your responses.
dls
The trick is to enable the 'Link to Editor' option in the Outline View dropdown menu. This seems to be off by default for CDT.
Quantum7
+1  A: 

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.

dls
A: 

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.

cornelius
+1  A: 

I'm using the "Toggle Breadcrumb" option from toolbar - 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.

bodunbodun
+1 Breadcrumbs are the way to go here.
abhin4v
This option is not available in C/C++ development.
Quantum7