views:

25

answers:

2

I know this is not programming related question so to speak, but since we are programmers and we might use Netbeans for PHP development.

I am wondering how can I get in Netbeans to update the comment block in front of a method, after I change the parameter set. I need to update it someway automatically, and to keep what I've been added there before.

Suppose I added 10 more parameters to the method, and I want that to appear in the comment section before(PHPdoc), how do I update the comment section?

A: 

If I read that right, you're hoping for some magic that will adjust your existing docblock whenever you edit the actual method signature in the code. I'd be very surprised if any IDE can do this.

I know that Eclipse can automatically populate a new docblock that you begin to write in front of the already coded method, showing @param tags automatically, but that's the extent of it. For an IDE to modify a docblock on the fly as you edit the code, ... that would get very complex, I'd think.

I really think you'll have to hand-edit your docblock, adding new @param tags to fit however you've modified your method.

ashnazg
A: 

You could try to add a new line after the last existing parameter definition and hit your auto-complete keys (usually ctrl-space). Eg:

/**
 * @var blah<new line here>
 */

And then

/**
 * @var blah
 * <ctrl-space>
 */

It might fill it in for you...

Blair McMillan
I've tried and it doesn't work.
Pentium10
Doesn't look like you'll have any luck then. You could try deleting the existing docblock (copy it) and get your IDE to regenerate it again. You could at least keep a copy of the function description. But you'd need to re-describe each argument etc.
Blair McMillan