Skip to content

Fix custom comment continuation for multiple follow-up lines - #14076

Merged
Sean McManus (sean-mcmanus) merged 3 commits into
mainfrom
bobbrow/cherryPick-commentContinuationFix
Dec 5, 2025
Merged

Sean McManus (sean-mcmanus) merged 3 commits into
mainfrom
bobbrow/cherryPick-commentContinuationFix

Conversation

@bobbrow

@bobbrow Bob Brown (bobbrow) commented Dec 2, 2025 •

Copy link
Copy Markdown
Contributor

Fixes: #8998

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

@bobbrow
Bob Brown (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 Bob Brown (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

Sean McManus (sean-mcmanus) commented Dec 3, 2025 •

Copy link
Copy Markdown
Contributor

Bob Brown (@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 (sean-mcmanus) merged commit 6559cc2 into main Dec 5, 2025
6 checks passed
@sean-mcmanus
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

3 participants