如何将 Visual Studio 注释期望与具有 Doxygen 注释的代码相协调?

Eri*_*ric 5 xml comments doxygen tooltip visual-studio

为 Doxygen 处理编写的代码有这样的行是正常的。

int myVariable; ///< description of myVariable
Run Code Online (Sandbox Code Playgroud)

但是,当 Visual Studio(例如 VS 2015)使用这些 Doxygen 注释准备的代码时,其工具提示信息myVariable将显示

XML comment contains invalid XML: Whitespace is not allowed at this location.

问题似乎是紧跟在“//”之后的“<”的存在。这似乎被 Visual Studio 解释为信号(格式不正确)的 XML 内容。但是,此组合与“<”一起存在,以向 Doxygen 发出信号,表明该注释适用于该行上的前一项,而不是后一项。

假设我们正在讨论已经遵循 Doxygen 约定的现有代码体。很多地方已经这样写了。

有没有办法调整或教授或设置 Visual Studio,以便它将此类注释视为前一项的正常文档注释,以便它们出现在这些项目的工具提示中?

alb*_*ert 1

Doxygen 有不同的注释样式(请参阅手册中有关“特殊注释块”的部分,在本例中是有关“将文档放在成员之后”的段落。在这里我们看到了可能性:

int var; /**< Detailed description after the member */
or
int var; //!< Detailed description after the member
//!<
or
int var; ///< Detailed description after the member
Run Code Online (Sandbox Code Playgroud)

在这种情况下,我们可以从 切换///<//!<