自动为 Eclipse CDT 中的函数生成注释(文档)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11592605/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Auto generate comments (documentation) for functions in eclipse CDT
提问by Ravi
I am using eclipse Juno with CDT. I have written a function in a cpp file and I want to add comments for the function. Does CDT supports Auto generate comments by "typing /** then press enter"? In my case the auto generated comments are only as follows.
我正在使用带有 CDT 的 Eclipse Juno。我在 cpp 文件中编写了一个函数,我想为该函数添加注释。CDT 是否支持通过“键入 /** 然后按 Enter”来自动生成注释?在我的情况下,自动生成的评论仅如下。
/**
*
*/
As explained here, I even configured to use Doxygen support.Go to C/C++ -> Editors -> Documentation Tool Comments: Doxygen.
正如这里所解释的,我什至配置为使用 Doxygen 支持。转到 C/C++ -> 编辑器 -> 文档工具评论:Doxygen。
I still get the comments as mentioned above. How can I configure eclipse to add comments of my own style?
我仍然收到上面提到的评论。如何配置 eclipse 以添加我自己风格的评论?
I changed comments even in Code templates. Go to C/C++ -> Code Style -> Code templates -> Comments. I changed Types, Fields, Methods. Still there is no luck for me.
我什至在代码模板中更改了注释。转到 C/C++ -> 代码样式 -> 代码模板 -> 注释。我更改了类型、字段、方法。对我来说仍然没有运气。
Can someone assist me on this?
有人可以帮助我吗?
Thanks, Ravi
谢谢,拉维
回答by Thirler
If you want the automated filling in of parameters etc, like Eclipse for Java does.
如果您想要自动填写参数等,就像 Eclipse for Java 那样。
Open your project properties. Then C++ General. Then select Doxygen as your documentation tool. The type /** as you did to get the fully filled comment.
打开您的项目属性。然后是C++通用。然后选择 Doxygen 作为您的文档工具。类型 /** 就像您为获得完全填充的评论所做的那样。
回答by Antonio
For completeness, since it usually works and there was no feedback about any specific problem of the user asking this question, I would like to point to the generally working solution.
为了完整起见,由于它通常有效并且没有关于提出此问题的用户的任何特定问题的反馈,因此我想指出一般有效的解决方案。
回答by bubble
Try to type it just above the function. It shall work. However not sure of the coding template.
尝试在函数上方键入它。它会起作用。但是不确定编码模板。