mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
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 <dustypomerleau@users.noreply.github.com>
This commit is contained in:
@@ -462,7 +462,7 @@
|
||||
"name": "punctuation.brackets.angle.rust"
|
||||
}
|
||||
},
|
||||
"end": "\\{",
|
||||
"end": "\\{|;",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.brackets.curly.rust"
|
||||
|
||||
Reference in New Issue
Block a user