Code blocks in triple slash Doxygen comments are formatted incorrectly

未关闭
#14,567 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@Colengms 已经在做这个了。

开始于 2026年9月18日。

评估

这个 Issue 还没有评估数据。

描述

bug Feature: Doc comments fixed Language Service verified
Environment
  • OS and Version: Windows 11 Enterprise version 10.0.26200
  • VS Code Version: 1.127.0
  • C/C++ Extension Version: 1.32.2
  • If using SSH remote, specify OS of remote machine: N/A
Bug Summary and Steps to Reproduce

Bug Summary:

If you place a Markdown code block inside inside a Doxygen comment that uses /// at the start of each line, and that comment contains any Doxygen tag, and you hover over a symbol to view its documentation, then indentation and // at the start of lines inside the code block is stripped.

The same comment switched to use //! formats correctly.

Steps to reproduce:

Write a function with documentation such as the following:

/// Test function
///
/// Example:
/// ```
/// // This program does the thing.
/// int main() {
///   DoThing();
///   return 0;
/// }
/// ```
/// \param x Test parameter
void DoThing(int x);

Expected behavior:

When hovering over the symbol, the documentation should be rendered as

Test function

Example:

// This program does the thing
int main() {
  DoThing(1);
  return 0;
}

Parameters:
x - Test parameter

Actual behavior:

The documentation renders like this instead

Test function

Example:

 This program does the thing
int main() {
DoThing(1);
return 0;
}

Parameters:
x - Test parameter

Removing the \param line or changing the comment style to //! results in the expected rendering.

Configuration and Logs
Occurs in a workspace that only contains a single .cpp file and no c_cpp_properties.json.
Other Extensions

No response

Additional context
Image
主要语言
TypeScript
星标
6.2k
派生
1.7k
平均合并
14 小时 46 分钟
30 天内合并 PR
61

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/vscode-cpptools 的其他 Issue

查看 microsoft/vscode-cpptools 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。