mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-22 19:34:16 +00:00
Merge #10420
10420: Parse outer attributes on StructPatternEtCetera r=jonas-schievink a=XFFXFF Try to fix https://github.com/rust-analyzer/rust-analyzer/issues/8610 Related pr in ungrammer: https://github.com/rust-analyzer/ungrammar/pull/41 Co-authored-by: zhoufan <1247714429@qq.com>
This commit is contained in:
commit
94fa49c0a3
7 changed files with 101 additions and 37 deletions
|
@ -1290,6 +1290,7 @@ impl BoxPat {
|
|||
pub struct RestPat {
|
||||
pub(crate) syntax: SyntaxNode,
|
||||
}
|
||||
impl ast::HasAttrs for RestPat {}
|
||||
impl RestPat {
|
||||
pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) }
|
||||
}
|
||||
|
@ -1418,7 +1419,7 @@ pub struct RecordPatFieldList {
|
|||
impl RecordPatFieldList {
|
||||
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
|
||||
pub fn fields(&self) -> AstChildren<RecordPatField> { support::children(&self.syntax) }
|
||||
pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) }
|
||||
pub fn rest_pat(&self) -> Option<RestPat> { support::child(&self.syntax) }
|
||||
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
|
||||
}
|
||||
|
||||
|
@ -3836,6 +3837,7 @@ impl AstNode for AnyHasAttrs {
|
|||
| MATCH_ARM_LIST
|
||||
| MATCH_ARM
|
||||
| IDENT_PAT
|
||||
| REST_PAT
|
||||
| RECORD_PAT_FIELD => true,
|
||||
_ => false,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue