X

Geertjan's Blog

  • October 14, 2012

Lost in Code?

Geertjan Wielenga
Product Manager

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.

Join the discussion

Comments ( 21 )
  • guest Sunday, October 14, 2012

    Very nice.

    I love NetBeans.


  • huionn Sunday, October 14, 2012

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


  • Geertjan Sunday, October 14, 2012

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


  • guest Sunday, October 14, 2012

    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


  • Geertjan Sunday, October 14, 2012

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


  • Sammo Sunday, October 14, 2012

    that is so coool, **smiling**


  • guest Monday, October 15, 2012

    neat!!


  • guest Monday, October 15, 2012

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


  • Geertjan Monday, October 15, 2012

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


  • Faisal Tuesday, October 16, 2012

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


  • guest Tuesday, October 16, 2012

    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.


  • Geertjan Tuesday, October 16, 2012

    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.


  • guest Wednesday, October 17, 2012

    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


  • Geertjan Wednesday, October 17, 2012

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


  • G-Biv Thursday, October 18, 2012

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


  • Geertjan Thursday, October 18, 2012

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


  • guest Thursday, October 18, 2012

    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


  • Geertjan Friday, October 19, 2012

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


  • jc Friday, October 19, 2012

    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


  • Geertjan Friday, October 19, 2012

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


  • guest Monday, October 22, 2012

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


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.