Visual studio auto complete Doxygen tags for C++

故事扮演 提交于 2020-08-27 07:02:53

问题


Is there a way to make visual studio automatically place the doxygen tags in a C++ source file ?

What I mean is for example this piece of code:

int foo(bool p);

If I type /// on top of it, Visual Studio automatically generates the following lines:

/// <summary>
/// 
/// </summary>
/// <param name="p"></param>
/// <returns></returns>
int foo(bool p);

My question is: is it possible to do the same with doxygen (when I type /**)? To make VS generate the following:

   /**
    * @brief
    * @param p
    * @return
    */
    int foo(bool p)

My question is about writing the documentation tags (not generating the final doxygen).


回答1:


I don't know why this did not pop out on my search on Visual Studio Marketplace, but this does the job using /*! doxygen tag.

https://marketplace.visualstudio.com/items?itemName=dragospop.CppDoxyComplete

Example:

/*!
 * 
 * 
 * \param b
 * \return 
 */
int foo(bool b)



回答2:


There is a setting in VS19 that does just that:

Tools > Options > Text Editor > C/C++ > CodeStyle > General > Generated documentation comments style

Set this to Doxygen (/**)




回答3:


I don't know why this did not pop out on my search on Visual Studio Marketplace

For the VS2019 version there is another extension based on the CppDoxyCompletion, but with a few more features.



来源:https://stackoverflow.com/questions/53010626/visual-studio-auto-complete-doxygen-tags-for-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!