Lost in Code?

Sometimes you're coding and you find yourself forgetting your context. For example, look at this situation:

The cursor is on line 52. Imagine you're coding there and you're puzzling on some problem for some time. Wouldn't it be handy to know, without scrolling up (and then back down again to where you were working), what the method signature looks like? And does the method begin two lines above the visible code or 10 lines? That information can now, in NetBeans IDE 7.3 (and already in the 7.3 Beta) very easily be ascertained, by putting the cursor on the closing brace of the code block:

As you can see, a new vertical line is shown parallel to the line numbers, connecting the end of the method with its start, as well as, at the top of the editor, the complete method signature, together with the number of the line on which it's found. Very handy. Same support is found for other file types, such as in JavaScript files.

Comments:

Very nice.
I love NetBeans.

Posted by guest on October 14, 2012 at 08:58 AM PDT #

I think current "Navigator" window can provide the similar context info (except line number of method signature).

Posted by huionn on October 14, 2012 at 09:02 AM PDT #

I never have the Navigator window open, for me it takes up too much space.

Posted by Geertjan on October 14, 2012 at 10:10 AM PDT #

What's the keyboard shortcut to activate this? I only have the (new) breadcrumbs at the bottom of the editor, but nothing at the top

Posted by guest on October 14, 2012 at 02:07 PM PDT #

Like I said above, put your cursor on the closing brace. Also look at the second screenshot where you see the closing brace highlighted.

Posted by Geertjan on October 14, 2012 at 02:54 PM PDT #

that is so coool, **smiling**

Posted by Sammo on October 14, 2012 at 03:08 PM PDT #

neat!!

Posted by guest on October 15, 2012 at 04:46 AM PDT #

Sorry, I don't get that display. I'm using the latest Dev-Build. Is there any option I need to turn on?

Posted by guest on October 15, 2012 at 10:38 AM PDT #

Simply select the closing brace for a method where you can't see the method signature.

Posted by Geertjan on October 15, 2012 at 04:13 PM PDT #

Pretty cool. I often forget my context when working across more than one file.

Posted by Faisal on October 15, 2012 at 10:45 PM PDT #

Sorry no dice. Not matter how I select the closing bracket (cursor before, cursor after, actually selecting it), nothing shows up for me. I guess it's some option that got messed up.

Posted by guest on October 16, 2012 at 11:46 AM PDT #

Probably you're not using NetBeans IDE 7.3 Beta. Drop me an e-mail at geertjan.wielenga@oracle.com and we'll sort it out together.

Posted by Geertjan on October 16, 2012 at 03:02 PM PDT #

On a different computer it does work strangely enough (using a daily build from last week). The problem with this feature is, that it doesn't really show the method's name but the corresponding opening bracket. I put my opening brackets on a new line (not the line with the method name) and in that case only the opening bracket is shown which is not really helpful

Posted by guest on October 17, 2012 at 09:57 AM PDT #

So select the last bracket and you'll see what I'm seeing -- the method signature.

Posted by Geertjan on October 17, 2012 at 10:49 AM PDT #

I also noticed a "bread crumb trail" along the bottom of the editor which is similarly as helpful. NetBeans is AWESOME!

Posted by G-Biv on October 18, 2012 at 04:37 AM PDT #

Yup, that's one of the cool new 7.3 features too.

Posted by Geertjan on October 18, 2012 at 04:39 AM PDT #

For me it does not show the method signature, it only shows the opening bracket (because it's on the next line)

In your example both are on the same line and therefor the method signature is shown as well.

See here: http://i.imgur.com/LYXLZ.png

Posted by guest on October 18, 2012 at 02:47 PM PDT #

I see. Makes sense. So, would you prefer for the method signature to be shown anyway? You can add an issue to NetBeans issuezilla about that (and put a link to it here, I'll try and get it prioritized).

Posted by Geertjan on October 18, 2012 at 11:14 PM PDT #

Hey I can't find this , i downloaded netbeans 7.3 beta but i don't know how to make it work .
I am using php version

Posted by jc on October 19, 2012 at 09:56 AM PDT #

Where in this blog do you read anything at all about PHP?

Posted by Geertjan on October 19, 2012 at 01:04 PM PDT #

This is cool but IMHO new Hierarchy viwever is what really was missing in earlier versions.

Posted by guest on October 22, 2012 at 02:11 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today