mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-02 04:48:13 +00:00
Rollup merge of #140035 - fee1-dead-contrib:push-oszwkkvmpkks, r=jieyouxu,wesleywiser
Implement RFC 3503: frontmatters Tracking issue: #136889 Supercedes #137193. This implements [RFC 3503](https://github.com/rust-lang/rfcs/blob/master/text/3503-frontmatter.md). This might break rust-analyzer. Will look into how to fix that. Suggestions welcome for how to improve diagnostics.
This commit is contained in:
commit
9f4e2cc51d
5 changed files with 18 additions and 1 deletions
|
|
@ -179,6 +179,15 @@ impl<'a> Converter<'a> {
|
|||
COMMENT
|
||||
}
|
||||
|
||||
rustc_lexer::TokenKind::Frontmatter { has_invalid_preceding_whitespace, invalid_infostring } => {
|
||||
if *has_invalid_preceding_whitespace {
|
||||
err = "invalid preceding whitespace for frontmatter opening"
|
||||
} else if *invalid_infostring {
|
||||
err = "invalid infostring for frontmatter"
|
||||
}
|
||||
FRONTMATTER
|
||||
}
|
||||
|
||||
rustc_lexer::TokenKind::Whitespace => WHITESPACE,
|
||||
|
||||
rustc_lexer::TokenKind::Ident if token_text == "_" => UNDERSCORE,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue