Skip to content

Commit 2067a41

Browse files
Merge #6275
6275: Textmate grammar: prevent unwanted interpolation scopes r=matklad a=dustypomerleau Fixes the issues noted by @matklad after merging #6248. 1. prevent accidental interpolation scopes when `{` is used in a string 1. prevent interpolations from extending beyond the end of a string Co-authored-by: Dusty Pomerleau <[email protected]>
2 parents 7c4bb97 + 06208e6 commit 2067a41

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

editors/code/rust.tmGrammar.json

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -694,23 +694,15 @@
694694
"interpolations": {
695695
"comment": "curly brace interpolations",
696696
"name": "meta.interpolation.rust",
697-
"begin": "{",
698-
"beginCaptures": {
699-
"0": {
697+
"match": "({)[^\"{}]*(})",
698+
"captures": {
699+
"1": {
700700
"name": "punctuation.definition.interpolation.rust"
701-
}
702-
},
703-
"end": "}",
704-
"endCaptures": {
705-
"0": {
701+
},
702+
"2": {
706703
"name": "punctuation.definition.interpolation.rust"
707704
}
708-
},
709-
"patterns": [
710-
{
711-
"include": "#interpolations"
712-
}
713-
]
705+
}
714706
},
715707
"lifetimes": {
716708
"patterns": [

0 commit comments

Comments
 (0)