Skip to content

Commit 22dbbd1

Browse files
fix: prevent /**/ from matching block doc comments
1 parent 0a715cf commit 22dbbd1

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

editors/code/rust.tmGrammar.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,14 @@
307307
"block-comments": {
308308
"patterns": [
309309
{
310-
"comment": "block comments",
310+
"comment": "empty block comments",
311311
"name": "comment.block.rust",
312-
"begin": "/\\*(?!\\*)",
312+
"match": "/\\*\\*/"
313+
},
314+
{
315+
"comment": "block documentation comments",
316+
"name": "comment.block.documentation.rust",
317+
"begin": "/\\*\\*",
313318
"end": "\\*/",
314319
"patterns": [
315320
{
@@ -318,9 +323,9 @@
318323
]
319324
},
320325
{
321-
"comment": "block documentation comments",
322-
"name": "comment.block.documentation.rust",
323-
"begin": "/\\*\\*",
326+
"comment": "block comments",
327+
"name": "comment.block.rust",
328+
"begin": "/\\*(?!\\*)",
324329
"end": "\\*/",
325330
"patterns": [
326331
{

0 commit comments

Comments
 (0)