Netbeans:PhpDoc 格式化

发布于 2024-08-18 01:03:17 字数 613 浏览 3 评论 0原文

如何在 Netbeans 中自动格式化 PhpDoc 注释?

我希望注释像这样对齐:

 * @author      Author Name <[email protected]>
 * @package     Doctrine
 * @subpackage  Table
 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
 * @version     $Revision: 67999 $
 * @link        www.phpdoctrine.org
 * @since       1.0

当我在 Netbeans 中键入 /**[Enter] 时,它会自动从方法定义中将所有参数导入为 @param 。但是,当注释已经生成时,我向定义添加一个新变量。现在怎么办?如何触发评论重解析并添加新添加的参数?

How to automatically format PhpDoc comments in Netbeans?

I'd like to have comments aligned like this:

 * @author      Author Name <[email protected]>
 * @package     Doctrine
 * @subpackage  Table
 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
 * @version     $Revision: 67999 $
 * @link        www.phpdoctrine.org
 * @since       1.0

When I type /**[Enter] in Netbeans, it automatically imports all parameters as @param from the method definition. But then, when the comment is already generated I add a new variable to the definition. What now? How to trigger comment reparse and add newly added parameter?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

把人绕傻吧 2024-08-25 01:03:17

在当前版本中不可能。我只是使用 TAB 来对齐文档。

Not possible in current version. I just use TAB to align the docs.

与之呼应 2024-08-25 01:03:17

不确定这是否有效,但它是一个格式化程序,允许您创建自定义配置文件,您可以在其中指定从注释块到类、字段、方法声明的所有内容的间距/缩进。它允许您按下 Ctrl+F 来根据您在配置文件中指定的内容自动设置代码格式。维护代码外观以提高可读性的好方法,无需涉及体力劳动。

http://en.sourceforge.jp/projects/pdt-tools/

Not sure if this will work, but its a formatter that allows you to create a custom profile where you dictate the spacing/indentation of everything from your comment blocks to your class, field, methods declarations. It allows you to be able to hit Ctrl+F to have your code automatically format according to what you specify in your profile. Great way of maintaining the appearance of your code for readability without the manual labor involved.

http://en.sourceforge.jp/projects/pdt-tools/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文