Skip to content

commentContinuationPatterns don't work correctly if an earlier pattern is a prefix of a later one #14081

@sean-mcmanus

Description

@sean-mcmanus

@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).

Originally posted by @sean-mcmanus in #14076 (comment)

Metadata

Metadata

Assignees

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions