diff --git a/editors/code/syntaxes/tests/comment.v b/editors/code/syntaxes/tests/comment.v new file mode 100644 index 00000000..abc3caf9 --- /dev/null +++ b/editors/code/syntaxes/tests/comment.v @@ -0,0 +1,5 @@ +// SYNTAX TEST "source.v" "comment" + #!/usr/bin/env -S v +// ^^ punctuation.definition.comment.shebang.v +// ^^^^^^^^^^^^^^^^^ meta.shebang.v +// ^^^^^^^^^^^^^^^^^^^ comment.line.number-sign.v diff --git a/editors/code/syntaxes/v.tmLanguage.json b/editors/code/syntaxes/v.tmLanguage.json index 16f8e9cb..cbd0b6ef 100644 --- a/editors/code/syntaxes/v.tmLanguage.json +++ b/editors/code/syntaxes/v.tmLanguage.json @@ -322,6 +322,18 @@ } }, "end": "$" + }, + { + "name": "comment.line.number-sign.v", + "match": "(?:^|\\s*)(?:((#!).*))", + "captures": { + "1": { + "name": "meta.shebang.v" + }, + "2": { + "name": "punctuation.definition.comment.shebang.v" + } + } } ] },