mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-01 20:31:59 +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
|
|
@ -133,6 +133,7 @@ Meta =
|
|||
|
||||
SourceFile =
|
||||
'#shebang'?
|
||||
'#frontmatter'?
|
||||
Attr*
|
||||
Item*
|
||||
|
||||
|
|
|
|||
|
|
@ -1524,6 +1524,10 @@ impl ast::HasAttrs for SourceFile {}
|
|||
impl ast::HasDocComments for SourceFile {}
|
||||
impl ast::HasModuleItem for SourceFile {}
|
||||
impl SourceFile {
|
||||
#[inline]
|
||||
pub fn frontmatter_token(&self) -> Option<SyntaxToken> {
|
||||
support::token(&self.syntax, T![frontmatter])
|
||||
}
|
||||
#[inline]
|
||||
pub fn shebang_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![shebang]) }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue