Code Completion for PHPDoc Tags

Posted by tomslot on Jun 13 2008, 06:48:43 PM CEST

We've just added code completion for PHPDoc tags. It pops up automatically when the user types '@' inside a PHPDoc comment. There are many areas to improve, in the future we are going to be more intelligent about the parameters for the commonly used tasks.

One neat feature that it already implemented is showing tag documentation including example of use:

 Screenshot: Code Completion for PHPDoc tags

 

Category: Features | Permalink | Comments [10]

Trackback URL: http://blogs.sun.com/netbeansphp/entry/code_completion_for_phpdoc_tags
Comments:

wow great, thanks...
wanna ask, is it this improvement will be in PHP plugin update or will available in future version (nb 6.5)

thanks

Posted by Anton Heryanto Hasan on June 14, 2008 at 07:52 AM CEST #

This is a part of 6.5 build. You can download the php ide as result of continual build of trunk at http://deadlock.netbeans.org/hudson/job/trunk/lastSuccessfulBuild/artifact/nbbuild/dist/zip/. There you can also download all in one version.

Posted by Petr Pisl on June 14, 2008 at 07:37 PM CEST #

hey sounds great,
can I have code completion for method calls, pls?
( $object -> getValue() )

Posted by Marius Kubatz on June 20, 2008 at 09:58 AM CEST #

Code completion for method works in some cases. The file has to be in a project and the file with the class has to be included or required in the edited file. We are working to work without these conditions. Correct me Tomasz, if I'm wrong.

Posted by Petr Pisl on June 20, 2008 at 11:35 PM CEST #

Ahh, thank you!
I have found out why it won't work in my project:

Server variables are not translated into paths., document root points to /var/www/

define("_SYSPATH",$_SERVER['DOCUMENT_ROOT']."system/");
include(_SYSPATH.'core/entity/Object.class.php');
$entity = new Object();
$entity-> no code completion here,

It works only with absolute paths, or relative paths...

Posted by Marius Kubatz on June 21, 2008 at 12:53 AM CEST #

Hi,

Great work on the project! I am currently using Zend Studio and this looks loads better already!

I had a question about phpDocs. Will you be able to auto generate them for say a function or variable. I really like this function in Zend Studio. You can just select a funtion and click a button and the phpDoc block with @var('s) is created for you above the function.

I am reluctantly starting to get in the habit of commenting my work so any shortcuts are good.

Regards,
Kevin

Posted by Kevin Bond on August 08, 2008 at 05:29 PM CEST #

Hi Kevin,

in NetBeans there is not exactly the same functionality as you described. But there is something similar.

Just write "/**" and press enter on a line before a function, class or field decalration. NetBeans will automatically generate stab of the PHPDoc for you.

For example on line 11 function declaration starts:

public function setNick($nick) {
...

When you write at line 10 /** and press enter, then NetBeans generates

/**
*
* @param <type> $nick
*/
public function setNick($nick)

Does it fits what you need? Thanks,
Petr

Posted by Petr on August 08, 2008 at 05:50 PM CEST #

Thanks Petr,

That is exactly what I was looking for!

-Kevin

Posted by Kevin Bond on August 11, 2008 at 04:51 PM CEST #

Hi sorry this is very late to the post, but how can i add some new @tagname to include by default when using the /** above the function as per Petr's Post.

Posted by Daniel on March 06, 2009 at 05:40 AM CET #

It was a very nice idea! Just wanna say thank you for the information you have shared. Just continue writing this kind of post. I will be your loyal reader. Thanks again.

Posted by links of london on October 31, 2009 at 03:18 AM CET #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed