microsoft / microsoft/vscode-cpptools

Doxygen `@code` block not formatted if without leading spaces; when formatted includes leading `*` and has 'escape' `\`.

Open
#14,430 0 comments 0 reactions 1 assignee View on GitHub

@sean-mcmanus is already working on this.

Since May 9, 2026.

bug Feature: Doc comments
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Using C/C++ v1.32.2

Some observations of the Doxygen support for @code or \code blocks:

  /**
   * @brief Set or clear the referenced bit.
   * 
   * @param value true to set the bit, false to clear it.
   * @return Reference to this BitReference object.
   * 
   * @code
   * uint8_t flags = 0b00000000;
   * BitReference<uint8_t> bit(flags, 2);
   * bit = true;  // flags == 0b00000100
   * bit = false; // flags == 0b00000000
   * @endcode
   */

Without 4 leading spaces (this only has 2) the code block is not rendered.

Image

With 4 leading spaces it looks like this:

Image

I might have expected:

  • A Code: header to preface the code block.
  • The *'s from the Doxygen block to not be present (shown as \*).
  • the extraneous \ that appear to be trying to escape *, _, < and > (and who knows what else) to not be present in the render.
  • The last line (the * before the @endcode) to not be included in the code block.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.