diff options
Diffstat (limited to 'editors/code/rust.tmGrammar.json')
-rw-r--r-- | editors/code/rust.tmGrammar.json | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/editors/code/rust.tmGrammar.json b/editors/code/rust.tmGrammar.json index 608a3354e..4759bb116 100644 --- a/editors/code/rust.tmGrammar.json +++ b/editors/code/rust.tmGrammar.json | |||
@@ -167,7 +167,7 @@ | |||
167 | "match": "(mod)\\s+((?:r#(?!crate|[Ss]elf|super))?[a-z][A-Za-z0-9_]*)", | 167 | "match": "(mod)\\s+((?:r#(?!crate|[Ss]elf|super))?[a-z][A-Za-z0-9_]*)", |
168 | "captures": { | 168 | "captures": { |
169 | "1": { | 169 | "1": { |
170 | "name": "keyword.control.rust" | 170 | "name": "storage.type.rust" |
171 | }, | 171 | }, |
172 | "2": { | 172 | "2": { |
173 | "name": "entity.name.module.rust" | 173 | "name": "entity.name.module.rust" |
@@ -180,7 +180,7 @@ | |||
180 | "begin": "\\b(extern)\\s+(crate)", | 180 | "begin": "\\b(extern)\\s+(crate)", |
181 | "beginCaptures": { | 181 | "beginCaptures": { |
182 | "1": { | 182 | "1": { |
183 | "name": "keyword.control.rust" | 183 | "name": "storage.type.rust" |
184 | }, | 184 | }, |
185 | "2": { | 185 | "2": { |
186 | "name": "keyword.other.crate.rust" | 186 | "name": "keyword.other.crate.rust" |
@@ -213,7 +213,7 @@ | |||
213 | "begin": "\\b(use)\\s", | 213 | "begin": "\\b(use)\\s", |
214 | "beginCaptures": { | 214 | "beginCaptures": { |
215 | "1": { | 215 | "1": { |
216 | "name": "keyword.control.rust" | 216 | "name": "keyword.other.rust" |
217 | } | 217 | } |
218 | }, | 218 | }, |
219 | "end": ";", | 219 | "end": ";", |
@@ -307,9 +307,14 @@ | |||
307 | "block-comments": { | 307 | "block-comments": { |
308 | "patterns": [ | 308 | "patterns": [ |
309 | { | 309 | { |
310 | "comment": "block comments", | 310 | "comment": "empty block comments", |
311 | "name": "comment.block.rust", | 311 | "name": "comment.block.rust", |
312 | "begin": "/\\*(?!\\*)", | 312 | "match": "/\\*\\*/" |
313 | }, | ||
314 | { | ||
315 | "comment": "block documentation comments", | ||
316 | "name": "comment.block.documentation.rust", | ||
317 | "begin": "/\\*\\*", | ||
313 | "end": "\\*/", | 318 | "end": "\\*/", |
314 | "patterns": [ | 319 | "patterns": [ |
315 | { | 320 | { |
@@ -318,9 +323,9 @@ | |||
318 | ] | 323 | ] |
319 | }, | 324 | }, |
320 | { | 325 | { |
321 | "comment": "block documentation comments", | 326 | "comment": "block comments", |
322 | "name": "comment.block.documentation.rust", | 327 | "name": "comment.block.rust", |
323 | "begin": "/\\*\\*", | 328 | "begin": "/\\*(?!\\*)", |
324 | "end": "\\*/", | 329 | "end": "\\*/", |
325 | "patterns": [ | 330 | "patterns": [ |
326 | { | 331 | { |
@@ -342,7 +347,7 @@ | |||
342 | "match": "\\b(const)\\s+([A-Z][A-Za-z0-9_]*)\\b", | 347 | "match": "\\b(const)\\s+([A-Z][A-Za-z0-9_]*)\\b", |
343 | "captures": { | 348 | "captures": { |
344 | "1": { | 349 | "1": { |
345 | "name": "keyword.control.rust" | 350 | "name": "storage.type.rust" |
346 | }, | 351 | }, |
347 | "2": { | 352 | "2": { |
348 | "name": "constant.other.caps.rust" | 353 | "name": "constant.other.caps.rust" |
@@ -404,7 +409,7 @@ | |||
404 | { | 409 | { |
405 | "comment": "booleans", | 410 | "comment": "booleans", |
406 | "name": "constant.language.bool.rust", | 411 | "name": "constant.language.bool.rust", |
407 | "match": "\\btrue|false\\b" | 412 | "match": "\\b(true|false)\\b" |
408 | } | 413 | } |
409 | ] | 414 | ] |
410 | }, | 415 | }, |
@@ -450,7 +455,7 @@ | |||
450 | "begin": "\\b(fn)\\s+((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)((\\()|(<))", | 455 | "begin": "\\b(fn)\\s+((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)((\\()|(<))", |
451 | "beginCaptures": { | 456 | "beginCaptures": { |
452 | "1": { | 457 | "1": { |
453 | "name": "keyword.control.fn.rust" | 458 | "name": "keyword.other.fn.rust" |
454 | }, | 459 | }, |
455 | "2": { | 460 | "2": { |
456 | "name": "entity.name.function.rust" | 461 | "name": "entity.name.function.rust" |
@@ -643,7 +648,7 @@ | |||
643 | { | 648 | { |
644 | "comment": "control flow keywords", | 649 | "comment": "control flow keywords", |
645 | "name": "keyword.control.rust", | 650 | "name": "keyword.control.rust", |
646 | "match": "\\b(async|await|break|continue|do|else|for|if|loop|match|move|return|try|where|while|yield)\\b" | 651 | "match": "\\b(await|break|continue|do|else|for|if|loop|match|return|try|while|yield)\\b" |
647 | }, | 652 | }, |
648 | { | 653 | { |
649 | "comment": "storage keywords", | 654 | "comment": "storage keywords", |
@@ -658,7 +663,7 @@ | |||
658 | { | 663 | { |
659 | "comment": "other keywords", | 664 | "comment": "other keywords", |
660 | "name": "keyword.other.rust", | 665 | "name": "keyword.other.rust", |
661 | "match": "\\b(as|become|box|dyn|final|impl|in|override|priv|pub|ref|typeof|union|unsafe|unsized|use|virtual)\\b" | 666 | "match": "\\b(as|async|become|box|dyn|move|final|impl|in|override|priv|pub|ref|typeof|union|unsafe|unsized|use|virtual|where)\\b" |
662 | }, | 667 | }, |
663 | { | 668 | { |
664 | "comment": "fn", | 669 | "comment": "fn", |