C++ 一个 doxygen eclipse 插件自动生成存根文档?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3537542/
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
A doxygen eclipse plugIn automatically generating stub documentation?
提问by LonliLokli
I'am looking for an eclipse-plugin for doxygen code documentation. I have found the eclox-plugIn ( http://home.gna.org/eclox/). I would like find out, how can it automatically generate a "empty" doxygen comment, which could be filled out later or what is the better choice for a documentation eclipse plugIn?
我正在寻找用于 doxygen 代码文档的 eclipse 插件。我找到了 eclox-plugIn ( http://home.gna.org/eclox/)。我想知道,它如何自动生成一个“空”的 doxygen 注释,可以稍后填写,或者文档 eclipse 插件的更好选择是什么?
For example for a function: void f(int p1, int p2, ...), it should generate:
例如对于一个函数:void f(int p1, int p2, ...),它应该生成:
/*! \brief ...
\param p1 ...
..
*/
PS I'm using for mainly the c/c++ languages
PS 我主要用于 c/c++ 语言
采纳答案by tauran
See updated solution.
请参阅更新的解决方案。
Old answer:
In eclipse helios in window->preferencesyou can do:
c/c++->Code Style->Code Templates->Comments+
Automatically add comments for new methods and classes
旧答案:
在窗口中的eclipse helios ->首选项中,您可以执行以下操作:
c/c++->代码样式->代码模板->注释+ 自动为新方法和类添加注释
You can configure the comment style here, but it is not as smart as it should be. If you find something better, I would be very happy...
您可以在此处配置注释样式,但它并不像应有的那样智能。如果你找到更好的东西,我会很高兴......
回答by tauran
A different (better) approach than my previous answer:
In Window->Preferences->C/C++->Editor,
In the right tab look for "Documentation tool comments", and in "Workspace default" set doxygen
.
与我之前的答案不同(更好)的方法:
在 Window->Preferences->C/C++->Editor 中,
在右侧选项卡中查找“文档工具注释”,并在“工作区默认值”中设置doxygen
。
Now you can type /**
above a function and press return.
现在您可以/**
在函数上方键入并按回车键。
/**
int foo(int bar);
becomes
变成
/**
*
* @param bar
* @return
*/
int foo(int bar);
回答by Antonio
For Project specific settings
In Project->Properties->C/C++ General:
对于特定于项目的设置
在 Project->Properties->C/C++ General 中:
- Tick Enable project specific Settings
- Select Doxygen as Documentation tool
- 勾选启用项目特定设置
- 选择 Doxygen 作为文档工具
Then typing /**
above the function/method and hitting enter will work. See here.
然后/**
在函数/方法上方键入并按回车键即可。见这里。