Skip to content

Commit 2d2b32a

Browse files
committed
Change lifetimes back to keyword-ish, tweak builtins for consistency between TextMate and semantic
1 parent 63b75a4 commit 2d2b32a

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

editors/code/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@
601601
"support.type.primitive"
602602
],
603603
"lifetime": [
604-
"entity.name.type.lifetime"
604+
"storage.modifier.lifetime.rust"
605605
],
606606
"typeAlias": [
607607
"entity.name.type.typeAlias"

editors/code/rust.tmGrammar.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -580,22 +580,25 @@
580580
},
581581
"lifetime": {
582582
"comment": "Named lifetime",
583-
"name": "entity.name.type.lifetime.rust",
583+
"name": "storage.modifier.lifetime.rust",
584584
"match": "'([a-zA-Z_][a-zA-Z0-9_]*)\\b"
585585
},
586586
"ref_lifetime": {
587587
"comment": "Reference with named lifetime",
588-
"match": "&('[a-zA-Z_][a-zA-Z0-9_]*)\\b",
588+
"match": "(&)('[a-zA-Z_][a-zA-Z0-9_]*)\\b",
589589
"captures": {
590590
"1": {
591-
"name": "entity.name.type.lifetime.rust"
591+
"name": "keyword.other.sigil.rust"
592+
},
593+
"2": {
594+
"name": "storage.modifier.lifetime.rust"
592595
}
593596
}
594597
},
595598
"core_types": {
596599
"comment": "Built-in/core type",
597-
"name": "entity.name.type.core.rust",
598-
"match": "\\b(bool|char|usize|isize|u8|u16|u32|u64|u128|i8|i16|i32|i64|i128|f32|f64|str|Self|Option|Result)\\b"
600+
"name": "support.type.primitive",
601+
"match": "\\b(bool|char|usize|isize|u8|u16|u32|u64|u128|i8|i16|i32|i64|i128|f32|f64|str|Self)\\b"
599602
},
600603
"core_vars": {
601604
"comment": "Core type variant",
@@ -615,7 +618,7 @@
615618
"std_types": {
616619
"comment": "Standard library type",
617620
"name": "entity.name.type.class.std.rust",
618-
"match": "\\b(Box|String|Vec|Path|PathBuf)\\b"
621+
"match": "\\b(Box|String|Vec|Path|PathBuf|Option|Result)\\b"
619622
},
620623
"std_traits": {
621624
"comment": "Standard library trait",

0 commit comments

Comments
 (0)