在Eclipse中更改doxygen注释样式 [英] Change doxygen comment style in Eclipse

查看:234
本文介绍了在Eclipse中更改doxygen注释样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道如何编辑Eclipse CDT中Doxygen注释使用的样式?



换句话说,键入/ **并按输入在一个函数之前,一个函数当前给我的东西像:

  / ** 
*
* @param one
* @param two
* @return
* /
Foo(int one,int two);

,我想让它给我一些像:

  / ************************************ ********************************** / 
///
/// \\ \\param one
/// \param two
/// \return
/ ********************* ************************************************** /
Foo(int one,int two);

另外,如果有人知道如何将其绑定到键盘快捷键(如 alt - shift - j for Eclipse JDT)



此外, CDT支持Doxygen现在似乎是基于Google的一个鲜为人知的事实。有关详细信息,请参阅此处。可以通过在C / C ++常规选项卡中选择启用项目特定设置并选择Doxygen,在项目属性下启用Doxygen。我的CDT版本是7.0.1,但我认为这在5.0中可用。



最后,首选项中的代码模板下的注释部分不会基于我的



编辑:
请参阅 here 。评论风格似乎是硬编码。如果有人发现,我很想知道。我猜,模板将是现在最好的,除非Javadoc的风格是可以的。

解决方案

是的,这似乎是Eclipse CDT中的错误。



作为解决方法,我建议您创建一个可以使用 Ctrl + 空间访问的自定义模板



在Eclipse Helios中:窗口 - >首选项 - > C / C ++ - >编辑器 - >模板 p>

点击新建... 创建一个新模板,然后在名称字段中使用一些描述性名称,例如comment-function,并在模式字段中添加你的doxygen注释。确认并应用此更改。



在您的代码中,您可以转到函数声明上方的行中,键入自定义模板名称的前几个字母,后跟< kbd> Ctrl + 空格组合键。



在此示例中:

  COM<按Ctrl +空间> 

将打开用com *过滤的内容辅助对话框,您可以从中选择评论功能模板。



注意:

  com&Ctrl键+空间+空间> 

只会在Content Assist弹出窗口中显示模板提案,进一步过滤。 >

Does anyone know how to edit the style used for Doxygen comments in Eclipse CDT?

In other words type /** and pressing enter on a line before a function currently gives me something like:

/**
 * 
 * @param one
 * @param two
 * @return
 */
Foo(int one, int two);

and I want it to give me something like:

/**********************************************************************/
///
/// \param one
/// \param two
/// \return
/***********************************************************************/
Foo(int one, int two);

Also, plus one if anyone knows how to bind this to a keyboard shortcut (like alt-shift-j for Eclipse JDT).

Also, FYI, the fact that Eclipse CDT supports Doxygen now seems to be a little known fact based on Google. See here for details. Doxygen can be enabled under the project properties by selecting "Enable project specific settings" in the "C/C++ General" tab and selecting "Doxygen". My CDT version is 7.0.1, but I think this became available in 5.0.

Lastly, the comments section under code templates in preferences doesn't accomplish this based on my testing.

EDIT: See here. It seems like the comment style is hard coded. If anyone finds otherwise, I'd love to know about it. I guess templates will be the best thing for now unless the Javadoc style is okay for you.

解决方案

Yes, this seems to be a bug in Eclipse CDT.

As a workaround I suggest you create a custom template which can be accessed with the Ctrl+Space key combination.

In Eclipse Helios: Window -> Preferences -> C/C++ -> Editor -> Templates

Click on New... to create a new template and in the Name field use some descriptive name e.g. "comment-function", and add your doxygen comment in the Pattern field. Confirm and apply this change.

In your code you can then go to the line above your function declaration, type the first few letters of your custom template name followed by the Ctrl+Space key combination.

In this example:

com<Ctrl+space>

will bring up the Content Assist dialog filtered with "com*" from which you can select the "comment-function" template.

Note:

com<Ctrl+space+space>

will filter even further by only showing Template Proposals in the Content Assist pop-up window.

这篇关于在Eclipse中更改doxygen注释样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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