Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modify command / template for function commenting in NetBeans. Triggering with "/** + Enter key" [duplicate]

Tags:

php

netbeans

I am using NetBeans for coding purpose. I found that when you type /** and press enter key then NetBeans auto generates comments for below defined function

ie. if my function is

function hello($param1, $param2){

}

and I type /** and press enter key above hello function, Then it automatically gives me function commenting

/**
 *
 * @param type $param1
 * @param type $param2 
 */
function hello($param1, $param2){

}

I want to modify this commenting and want to add more parameters like @author, @package, @version. I have checked in templates section but not found this template (Templates are triggering with abbreviation + tab, And /** commenting is triggering with enter key. So it might be somewhere else)

Can anyone guide me to achieve below output when /** + enter key pressed

/**
 * @author  Mujaffar S     Created on 03 Sep 2013
 * @param   type $param1
 * @param   type $param2
 * @package default
 * @version 1.1 
 */
function hello($param1, $param2){

}

For reference I am using PHP package as developing code in PHP project

Thanks in advance

like image 644
mujaffars Avatar asked Sep 03 '13 12:09

mujaffars


1 Answers

After lots of research and actually digging through the Netbeans source, the only way to go about this would be to fork a version of Netbeans where you add this functionality yourself, but this is not possible in any release of Netbeans at the time of this post.

I spent multiple days searching for an answer where people suggested the wrong things (like setting up variables in file templates instead of code templates, or the doc listing the file template variables under "code templates", etc.) or just never got an answer, so for all of the other people like me searching for this, it's just sadly not possible at the moment.

like image 78
Brian Leishman Avatar answered Nov 14 '22 23:11

Brian Leishman