diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-11-03 07:48:24 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-11-03 07:48:24 +0000 |
commit | 658e97a39e77bcb978697a66ddccd7e4b58990cf (patch) | |
tree | 01949b65f93b9d3e50d71cef0f613595a1d9480d /editors | |
parent | 65b44d2ba5145c354f03423222992e212a8e93e0 (diff) | |
parent | 01a228f68904f8ed9dbc2f4e4c348744fc50084d (diff) |
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]>
Diffstat (limited to 'editors')
-rw-r--r-- | editors/code/rust.tmGrammar.json | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/editors/code/rust.tmGrammar.json b/editors/code/rust.tmGrammar.json index b3eec327b..1d11d2c19 100644 --- a/editors/code/rust.tmGrammar.json +++ b/editors/code/rust.tmGrammar.json | |||
@@ -462,7 +462,7 @@ | |||
462 | "name": "punctuation.brackets.angle.rust" | 462 | "name": "punctuation.brackets.angle.rust" |
463 | } | 463 | } |
464 | }, | 464 | }, |
465 | "end": "\\{", | 465 | "end": "\\{|;", |
466 | "endCaptures": { | 466 | "endCaptures": { |
467 | "0": { | 467 | "0": { |
468 | "name": "punctuation.brackets.curly.rust" | 468 | "name": "punctuation.brackets.curly.rust" |