VS Code C++ (Cpptools) 扩展支持什么标记格式来渲染定义预览悬停?

JCS*_*CSB 6 c++ visual-studio-code

我在我添加到我的工作区之一的库中看到了这个文档格式注释,我发现它使用了类似于 doxygen 的东西,并且它与 VS code 配合使用现成的效果很好,我没有安装 doxygen 或任何其他文档生成器插入

  /**********************************************************************/
  /*!
    @brief  Apply the bracket's calibration curve to get a load in N from signal in mV
    @param  mV_reading    The loadcell's input signal in mV
  */
  /**********************************************************************/
    float _getTorqueNmFromBracketCurve(float mV_reading);
Run Code Online (Sandbox Code Playgroud)

它工作得非常好,并且在拖动函数时会生成漂亮的文档

在此输入图像描述

有人可以告诉我这个文档是什么以及在哪里可以找到它的语法文档/参数来学习使用它吗?

rus*_*tyx 5

Visual StudioVisual Studio Code可识别Doxygen注释格式。

/**/*!以及///- 风格的注释都受支持。

还有一些扩展可以生成doxygen 注释。


hei*_*ohn 5

只有部分语法可以被 VSCode 解析。

参考:MS C++ 团队的文章:C++ 团队博客 - Visual Studio Code C++ 扩展 2020 年 7 月更新:Doxygen 注释和日志点

/// @brief Calculates the area of the triangle
/// @tparam T is the template param
/// @param base is the horizontal length
/// @param height is the vertical length
/// @return Area of triangle
/// @deprecated This is the deprecated comment
template<typename T>
T TriangleArea(T base, T height)
{
    double result;
    result = base * height * 0.5;
    return (T)result;
}
Run Code Online (Sandbox Code Playgroud)

imgur - doxygen VSCode 视觉图片

VS C++ 团队可以做很多事情。

喜欢: