Skip to content

Conversation

@bobbrow
Copy link
Member

@bobbrow bobbrow commented Dec 2, 2025

Fixes: #8998

Cherry-picks the original change from the release branch. It should have gone to main first.
Also adds a unit test.

@bobbrow bobbrow requested a review from a team as a code owner December 2, 2025 18:16
@github-project-automation github-project-automation bot moved this to Pull Request in cpptools Dec 2, 2025
@bobbrow bobbrow changed the title Fix custom comment continuation for multiple follow-up lines (#14074) Fix custom comment continuation for multiple follow-up lines Dec 2, 2025
@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Dec 3, 2025

@bobbrow There's a bug whenever one begin pattern is a prefix of another, e.g. if // and /// or /* and `/*!" are used, it causes the "continue" of the non-matching, shorter pattern to be used.

This works correctly,

    "C_Cpp.commentContinuationPatterns": [
        {
            "begin": "/*!",
            "continue": " ! "
        }
    ],

but adding a "/*" breaks it (uses * as the continuation instead):

    "C_Cpp.commentContinuationPatterns": [
        "/*",
        {
            "begin": "/*!",
            "continue": " ! "
        }
    ],

similarly, "//" is used as the continue for "///".

I could file a new bug for that (it's a pre-existing bug and not a regression from this PR).

UPDATE: I moved it to #14081 (with a fix at #14082)

@sean-mcmanus sean-mcmanus merged commit 6559cc2 into main Dec 5, 2025
6 checks passed
@sean-mcmanus sean-mcmanus deleted the bobbrow/cherryPick-commentContinuationFix branch December 5, 2025 17:03
@github-project-automation github-project-automation bot moved this from Pull Request to Done in cpptools Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

C_Cpp.commentContinuationPatterns only recognized for follow-up line

4 participants