Skip to content

Commit 658e97a

Browse files
Merge #6447
6447: Textmate grammar: allow function declarations without curly brackets r=lnicola a=dustypomerleau Functions inside trait declarations can break subsequent highlighting, because they have no curly brackets. In a case such as: ```rust pub trait Summary { fn summarize(&self) -> String; } ``` the scope `meta.function.definition.rust` will continue past the end of the block looking for `{` after `fn`. This PR allows `meta.function.definition.rust` to terminate with `;` in these cases. Co-authored-by: Dusty Pomerleau <[email protected]>
2 parents 65b44d2 + 01a228f commit 658e97a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

editors/code/rust.tmGrammar.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@
462462
"name": "punctuation.brackets.angle.rust"
463463
}
464464
},
465-
"end": "\\{",
465+
"end": "\\{|;",
466466
"endCaptures": {
467467
"0": {
468468
"name": "punctuation.brackets.curly.rust"

0 commit comments

Comments
 (0)