mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
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:
parent
9eb6cbb80b
commit
26b4b1e2fb
1 changed files with 34 additions and 19 deletions
|
@ -24,6 +24,9 @@
|
|||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#block-comments"
|
||||
},
|
||||
{
|
||||
"include": "#comments"
|
||||
},
|
||||
|
@ -184,6 +187,9 @@
|
|||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#block-comments"
|
||||
},
|
||||
{
|
||||
"include": "#comments"
|
||||
},
|
||||
|
@ -211,6 +217,9 @@
|
|||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#block-comments"
|
||||
},
|
||||
{
|
||||
"include": "#comments"
|
||||
},
|
||||
|
@ -231,6 +240,9 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#block-comments"
|
||||
},
|
||||
{
|
||||
"include": "#comments"
|
||||
},
|
||||
|
@ -277,23 +289,22 @@
|
|||
{
|
||||
"comment": "documentation comments",
|
||||
"name": "comment.line.documentation.rust",
|
||||
"match": "^\\s*///.*",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comments"
|
||||
}
|
||||
]
|
||||
"match": "^\\s*///.*"
|
||||
},
|
||||
{
|
||||
"comment": "line comments",
|
||||
"name": "comment.line.double-slash.rust",
|
||||
"match": "\\s*//.*",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comments"
|
||||
}
|
||||
]
|
||||
"match": "\\s*//.*"
|
||||
},
|
||||
{
|
||||
"comment": "inferred types, wildcard patterns, ignored params",
|
||||
"name": "comment.char.underscore.rust",
|
||||
"match": "\\b_\\w*\\b[^!(]"
|
||||
}
|
||||
]
|
||||
},
|
||||
"block-comments": {
|
||||
"patterns": [
|
||||
{
|
||||
"comment": "block comments",
|
||||
"name": "comment.block.rust",
|
||||
|
@ -301,7 +312,7 @@
|
|||
"end": "\\*/",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comments"
|
||||
"include": "#block-comments"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -312,14 +323,9 @@
|
|||
"end": "\\*/",
|
||||
"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": [
|
||||
{
|
||||
"include": "#block-comments"
|
||||
},
|
||||
{
|
||||
"include": "#comments"
|
||||
},
|
||||
|
@ -516,6 +525,9 @@
|
|||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#block-comments"
|
||||
},
|
||||
{
|
||||
"include": "#comments"
|
||||
},
|
||||
|
@ -797,6 +809,9 @@
|
|||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#block-comments"
|
||||
},
|
||||
{
|
||||
"include": "#comments"
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue