修改命令/模板以在NetBeans中进行功能注释.使用"/** + Enter键"触发 [英] Modify command / template for function commenting in NetBeans. Triggering with "/** + Enter key"

查看:81
本文介绍了修改命令/模板以在NetBeans中进行功能注释.使用"/** + Enter键"触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用NetBeans进行编码.我发现当您键入/** 并按 enter 键时,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

即.如果我的功能是

function hello($param1, $param2){

}

然后我键入/** 并按hello功能上方的 enter 键,然后它会自动为我提供功能注释

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){

}

我想修改此注释,并想添加更多参数,例如@ author,@ package,@ version.我已经检查了模板"部分,但未找到此模板(模板是使用缩写+标签触发的,而/** 注释是使用Enter键触发的.所以它可能在其他位置)

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)

按下/** + enter (输入)键时,任何人都可以指导我实现以下输出效果

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){

}

作为参考,我正在使用PHP包作为PHP项目中的开发代码

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

预先感谢

推荐答案

经过大量研究并实际挖掘了Netbeans的源代码之后,实现此目的的唯一方法是派生一个NetBeans版本,您可以在其中自己添加此功能. ,但这在撰写本文时在任何版本的Netbeans中都是 不可能 .

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.

我花了几天来寻找人们提出错误建议的答案(例如在文件模板而不是代码模板中设置变量,或者doc在代码模板"下列出文件模板变量的文档)等等),或者永远都找不到答案,因此对于像我这样的所有其他人来说,目前无法实现这一点.

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.

这篇关于修改命令/模板以在NetBeans中进行功能注释.使用"/** + Enter键"触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆