问题
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