-
Notifications
You must be signed in to change notification settings - Fork 597
Labels
Description
What happened?
The following macro gives an erroneous source.rust meta.macro.rust invalid.illegal.rust
scope:
macro_rules! test {
($($name:ident),+$(,)?) => {
pub struct Foo {
$(
pub $name : Option<String>
),+
}
pub async fn thing() -> () {}
}
}
From a cursory view in the repository and from testing it seems this is applied because of this rule
Packages/Rust/Rust.sublime-syntax
Lines 1071 to 1080 in 9ba6b93
macro-semi-sep: | |
- include: comments | |
- match: ';' | |
scope: punctuation.terminator.rust | |
pop: true | |
- match: '(?=[})\]])' | |
pop: true | |
- match: '\S' | |
# This is intended to help make it evident when you forget a semicolon. | |
scope: invalid.illegal.rust |
Adding the ;
after the struct
definition does make the scope go away but ironically it leads to invalid code since you can't have ;
after a struct definition:
error: expected item, found `;`
--> src/main.rs:15:2
|
15 | };
| ^ help: remove this semicolon
|
= help: braced struct declarations are not followed by a semicolon