fix: prevent line comments inside block comments

- prevent line comments inside block comments
- prevent underscore-prefixed functions and macros from receiving comment scope
This commit is contained in:
Dusty Pomerleau 2020-10-22 13:03:04 +11:00
parent 9eb6cbb80b
commit 26b4b1e2fb

View file

@ -24,6 +24,9 @@
} }
}, },
"patterns": [ "patterns": [
{
"include": "#block-comments"
},
{ {
"include": "#comments" "include": "#comments"
}, },
@ -184,6 +187,9 @@
} }
}, },
"patterns": [ "patterns": [
{
"include": "#block-comments"
},
{ {
"include": "#comments" "include": "#comments"
}, },
@ -211,6 +217,9 @@
} }
}, },
"patterns": [ "patterns": [
{
"include": "#block-comments"
},
{ {
"include": "#comments" "include": "#comments"
}, },
@ -231,6 +240,9 @@
} }
] ]
}, },
{
"include": "#block-comments"
},
{ {
"include": "#comments" "include": "#comments"
}, },
@ -277,23 +289,22 @@
{ {
"comment": "documentation comments", "comment": "documentation comments",
"name": "comment.line.documentation.rust", "name": "comment.line.documentation.rust",
"match": "^\\s*///.*", "match": "^\\s*///.*"
"patterns": [
{
"include": "#comments"
}
]
}, },
{ {
"comment": "line comments", "comment": "line comments",
"name": "comment.line.double-slash.rust", "name": "comment.line.double-slash.rust",
"match": "\\s*//.*", "match": "\\s*//.*"
"patterns": [
{
"include": "#comments"
}
]
}, },
{
"comment": "inferred types, wildcard patterns, ignored params",
"name": "comment.char.underscore.rust",
"match": "\\b_\\w*\\b[^!(]"
}
]
},
"block-comments": {
"patterns": [
{ {
"comment": "block comments", "comment": "block comments",
"name": "comment.block.rust", "name": "comment.block.rust",
@ -301,7 +312,7 @@
"end": "\\*/", "end": "\\*/",
"patterns": [ "patterns": [
{ {
"include": "#comments" "include": "#block-comments"
} }
] ]
}, },
@ -312,14 +323,9 @@
"end": "\\*/", "end": "\\*/",
"patterns": [ "patterns": [
{ {
"include": "#comments" "include": "#block-comments"
} }
] ]
},
{
"comment": "inferred types, wildcard patterns, ignored params",
"name": "comment.char.underscore.rust",
"match": "\\b_\\w*\\b"
} }
] ]
}, },
@ -450,6 +456,9 @@
} }
}, },
"patterns": [ "patterns": [
{
"include": "#block-comments"
},
{ {
"include": "#comments" "include": "#comments"
}, },
@ -516,6 +525,9 @@
} }
}, },
"patterns": [ "patterns": [
{
"include": "#block-comments"
},
{ {
"include": "#comments" "include": "#comments"
}, },
@ -797,6 +809,9 @@
} }
}, },
"patterns": [ "patterns": [
{
"include": "#block-comments"
},
{ {
"include": "#comments" "include": "#comments"
}, },