简体   繁体   中英

Comment Line in tmLanguage starts with .* TextMate Grammar Syntax Highlight

I am working on my own Syntax Highlighting extension for VS code and I have comment lines that start with ".*" which I want to highlight.

For code I have:

"comment": {
    "patterns": [{
        "name": "comment.line.as",
        "match":  "(\.\*).*$\n?",
        "captures": {
            '1': {
                "name": "punctuation.definition.comment.as"
            }
        }
    }]
}

But this does not seems to add the correct comment scope to my lines that begin with .*.

Thank you for your help.

Simple mistake, since this is in a .json file and the regex is in between quotes I have to escape the escape characters. . become \\. * become \\* etc...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM