Code Completion for PHPDoc Tags

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

 

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 12: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 12: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 02: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 04: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 20, 2008 at 05:53 PM 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 10:29 AM 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 10:50 AM CEST #

Thanks Petr,

That is exactly what I was looking for!

-Kevin

Posted by Kevin Bond on August 11, 2008 at 09:51 AM 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 05, 2009 at 09:40 PM CET #

Just started using Netbeans and this is exactly what I'm looking for. I've been manually commenting my work for a while.

Thanks

Posted by Miguel Cudaihl on February 12, 2010 at 02:10 AM CET #

I using netbeans 6.8 and for me auto completion don't work. If i write "/\*\*" before my function etc and press Enter i get
"/\*\*
\*
\*/"
How to fix it ?

Posted by Tomas on April 08, 2010 at 08:16 AM CEST #

My auto completion stopped working, too. If you type "/\*\*" before a coded class you get an empty: "/\*\*
\*
\*/"

When you type "/\*\*" before interfaces or functions you will get an open comment:
"/\*\*
\*"

This worked in Netbeans 6.7 Is this a degression through a recent update?

The PHP Doc hints/tool tips from older entries still work...

Posted by Andreas on April 22, 2010 at 05:27 AM CEST #

Just type / * * (without the spaces)
(You do not need to escape the * anymore)

Posted by guest on July 03, 2011 at 06:47 AM CEST #

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