Marking occurrences improved

Mark occurrences is not a new feature, but the trunk contains some improvements in this area. In the source the feature highlights in the elements which is under the cursor position. You can also easily move between marked occurrences through ALT + UP and ALT + DOWN shortcuts.

I'm going to show you some differences. On the pictures there is on the left side screenshot of NetBeans 6.5 and on the right side screenshot of the same source, but from NetBeans 7.0 development build.

Class fields are also marked in the PHP doc.


Parameters of a function or a method are also marked in the PHP doc.

Types are marked in the PHP doc as well.

NetBeans are now able to mark the same methods in  method chains.


Comments:

Hello,

I use this comment to post a feature request :-)

I think a lot of developers are using foreach to iterate over arrays containing objects. So, I'm missing CodeCompletion inside this Foreach...

So I have some code to show a possible solution:

class Person
{
public $id;
public $name;

/\*\*
\* @return array of Person
\*/
public static function loadList()
{
return $list;
}
}

$list = Peron::loadList();
foreach( $list as $l_value )
{
echo $l_value->name // Here I would like to have CodeCompletion...
}

Perhaps it is possile to the DocBlock @return with "array of object" to know that the variable contains an array of objects, so it can be used in a foreach to show CodeCompletion.

What do you say? Is it possible?

Thanks for your time,
Stefan Sturm

Posted by Stefan Sturm on December 18, 2008 at 03:36 AM CET #

Another possibility is to implement variable type hinting (@var):

foreach( $list as $l_value )
{
/\* @var $l_value Person \*/
echo $l_value->name // Here I would like to have CodeCompletion...
}

There's bug already filled for it:
http://www.netbeans.org/issues/show_bug.cgi?id=146248

Posted by Michal on December 18, 2008 at 04:44 AM CET #

@Michael:
I voted for this bug( feature ). I hope it will be fixed( added ) asap...

Stefan

Posted by Stefan Sturm on December 18, 2008 at 05:29 AM CET #

Hi Stefan and Michael,

I and Radek we are currently working on the mentioned issue. I think that the bulk of the work is already done and it will be available in the trunk soon.

Regards,
Petr

Posted by Petr on December 18, 2008 at 05:36 AM CET #

@Petr:
Great to hear :-)

Stefan

Posted by Stefan Sturm on December 18, 2008 at 05:42 AM CET #

You guys are rocking! Cheers ;)

Posted by N, Varun on December 18, 2008 at 09:28 AM CET #

Hi Petr,

Is there a simple way to upgrade between dev/nightly releases? I see that each installer installs in a separate folder and I have to import again the projects and to the ide settings all over again.

Thanks!
-soso

Posted by soso on December 22, 2008 at 08:08 AM CET #

To Soso:

I use the dev builds as well, but I don't use installers. I always use the OS independent zip files. So download the zip file, delete the old version or unzip it in a different folder and run the new version with the same userdir (--userdir switch - http://blogs.sun.com/netbeansphp/entry/userdir ).

Regards,
Petr

Posted by Petr on December 22, 2008 at 11:03 AM CET #

Got it!

Thanks Petr!

Posted by soso on December 22, 2008 at 02:31 PM CET #

Hi, I've been using Netbeans 6.5 and run the latest update, but I can't see this feature yet. What should I do to download/install/use this feature (or any that is mentioned in this blog)?

Thanks,
Robert

Posted by Robert A. Henru on February 10, 2009 at 08:44 PM CET #

Hi, I've been using Netbeans 6.5 and run the latest update

Posted by tiffany and co on November 13, 2009 at 10:46 PM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
About

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

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today