Code Navigation Improvements

When you work on a project, you need to navigate around the source code frequently.  NetBeans  IDE provides many navigation features that are highly useful since 6.5 but there were additional improvements and fixes in 6.7 that are worth of mentioning.

Go to File (Alt+Shift-O)

Much faster now, type file name and you will be pleasantly surprised how fast it is, its the difference especially on huge projects.   

Go to Type (Ctrl-O)

Camel cases can be used now. You can try any of following patterns :

  • MyDatabaseResult
  • MDR

if you wish to find MyDatabaseResult class/interface.

Quick Search (Ctrl-I)

Quickly search for action or type is now easy.

Go to Symbol (Ctrl+Alt+Shift-O)

Powerful - finds  functions, methods, fields, constants, types. Just type its  plane name or camel case patterns.

Go to Test (Ctrl+Shift-T)

PHPUnit support was added to NetBeans. Use Go to Test action it if you need to switch between test and tested source file.

Go to Declaration (Ctrl-B)

Radically improved, fixed many problems, more reliable. One of its improvements described here Go to Declaration for class members

The paragraphs above highlits code navigation improvements in 6.7 that should be released very soon. Release Candidate 3 is now available for download.


"Go to File (Ctrl+Shift-O) "

You mean Alt+Shift-O ?

Go to Type (Ctrl-O) - Buggy:
Have FilmMan.class.php

typing FILM - nothing found
typing \*film - nothing found
typing \*Film - found
FiLm -- nothing found

Posted by Pet on June 22, 2009 at 01:03 PM CEST #

Hi Pet,
thanks for commenting: I've updated blog entry. You are right that also \*film should probably be found - so thanks for finding a bug. On the other hand in queries: FILM and \*FiLm not found as expected (for \*FiLm should compound word look FiLmMan).

Posted by radek on June 23, 2009 at 02:03 AM CEST #

"FILM and \*FiLm not found as expected"

I don't catch it. It is case insensitive, so should be found

Posted by Pet on June 23, 2009 at 02:20 AM CEST #

there is no switch like now use: camel cases search, case insensitive search, wildcards search. Upper case letters in search string is such a switch, thus in \*FiLm 'F' and 'L' are expected to be first capitalized letters in elements forming the compound word, but if you believe it should work the other way - report it

Posted by radek on June 23, 2009 at 04:43 AM CEST #

It's ok, now I understand what camel case is. :)

Improvement could be to prefer current file. I.e. If I search a function name, first hit should be from current file. Or even better, a flag to restrict searching only in current file. It currently to slow for big project if using \*partname as pattern. So searching a function in file would be quicker then, I suppose

Posted by Pet on June 23, 2009 at 05:58 AM CEST #

Would we expect to navigate a hierarchical tree? jump up and down? transition to an parent's overloaded method? and visual hints near overloaded methods like in PDT2.0? And very well it would be quickly moved inside the bundle model-view-controller.

I have more than 300 classes. A lack of support the OOP. I will wait very much.


Posted by alexey_baranov on June 23, 2009 at 06:33 AM CEST #

How about being able to edit a readonly file, its too tedious to change to Windows Explorer to change this value59

Posted by Stephen on June 23, 2009 at 06:36 AM CEST #

to alexey_baranov:
yes, everything you mention is in our plan for 6.8 though not top priority, but definitely these features I personally like very much and I would like to see them implemented

Posted by radek on June 23, 2009 at 07:11 AM CEST #

to Stephen:
can you explain what NetBeans could do for you. Read only files are just for reading, but probably I don't understand your request

Posted by radek on June 23, 2009 at 07:14 AM CEST #

I really like ctrl+O, however, it would be a lot more useful to me if it had some support for Zend Framework/PEAR naming conventions.

So while its cool that I can get to MyDatabaseResult just by typing "MDR" that is worth nothing to me because the class is named "My_Database_Result". This is one of the points where NetBeans could be worth so much to me, but isn't, just because it doesn't handle naming conventions.
Is there any chance you could change that? (Or point me to where I can download the sources and maybe a faint idea of where to change it?)


Posted by Patrick Gotthardt on June 23, 2009 at 10:59 AM CEST #

I agree underscores should be ignored in any searching of files, types, etc.

Posted by Pet on June 23, 2009 at 11:28 AM CEST #

to Patrick:

of course generally speaking you are right that we should support php conventions at first place, on the other hand I think that MDR query works fine for class My_Database_Result or it doesn't work for you?

Posted by radek on June 23, 2009 at 02:02 PM CEST #


did you change that behaviour since RC2? Just tried in RC3 and indeed it does do something.

However, it still doesn't do the "right" thing. Let's take the Zend Framework for an example.
Say I'd like to go to the "Zend_Form" class. In an ideal world, I'd just type "ZF" and be there (that'd be the case if the class was named "ZendForm").
Now the problem with the query "ZF" is that I just don't know where the Zend_Form class is. I got like 20-thousand results. Among those are "Zend_Auth_Adapter_Http_Resolver_File" and other classes that I never intended to look for.
So it appears to me that a very fuzzy search is used to find the file (basicly: /Z.\*F.\*/).

I'd like a more "java-like" behaviour on this one, where the "_" is treated as if it was just another lowercase letter, so "ZF" would find everything that matches /Z[a-z_]\*F.\*/ - that is: it should be case sensitive and not allow any uppercase letter between "Z" and "F" to appear.

Hope that helps,
- Patrick

Posted by Patrick Gotthardt on June 24, 2009 at 03:57 AM CEST #

to Patrick:

you know what you want and I admit it makes sense, so report it as enhancement, please.

Posted by radek on June 24, 2009 at 04:53 AM CEST #

This is one of the points where NetBeans could be worth so much to me, but isn't, just because it doesn't handle naming conventions.

Posted by deeper voice on August 29, 2009 at 05:06 AM CEST #

Sometimes you want indexing turned off for a folder because you know, there's nothing important (index-wise) in it, but still you need to be able to edit some of it's files.

Posted by Malware Removal Bot on September 02, 2009 at 04:09 AM CEST #

when developping in java with Netbeans, I used Navigate goto source, then the arrow to go back. I do not have that in php Netbeans developpement why ? Can you add this ?

Posted by java to php on June 13, 2011 at 04:36 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed

This blogs is written by NetBeans developers who contribute to the PHP support mainly.


« August 2016