From f90fbaf6a6ce9d41f712001e0f430e2ba0c4fbe6 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sun, 3 May 2020 18:00:27 +0800 Subject: [PATCH] Add documents owner for ImplDef and SourceFile --- crates/ra_syntax/src/ast/generated/nodes.rs | 2 ++ xtask/src/ast_src.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 5e844d5aea..c2cc25958c 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs @@ -12,6 +12,7 @@ pub struct SourceFile { } impl ast::ModuleItemOwner for SourceFile {} impl ast::AttrsOwner for SourceFile {} +impl ast::DocCommentsOwner for SourceFile {} impl SourceFile { pub fn modules(&self) -> AstChildren { support::children(&self.syntax) } } @@ -259,6 +260,7 @@ pub struct ImplDef { } impl ast::TypeParamsOwner for ImplDef {} impl ast::AttrsOwner for ImplDef {} +impl ast::DocCommentsOwner for ImplDef {} impl ImplDef { pub fn default_token(&self) -> Option { support::token(&self.syntax, T![default]) } pub fn const_token(&self) -> Option { support::token(&self.syntax, T![const]) } diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs index 028f7cbe16..2f8065b731 100644 --- a/xtask/src/ast_src.rs +++ b/xtask/src/ast_src.rs @@ -305,7 +305,7 @@ macro_rules! ast_enums { pub(crate) const AST_SRC: AstSrc = AstSrc { tokens: &["Whitespace", "Comment", "String", "RawString"], nodes: &ast_nodes! { - struct SourceFile: ModuleItemOwner, AttrsOwner { + struct SourceFile: ModuleItemOwner, AttrsOwner, DocCommentsOwner { modules: [Module], } @@ -401,7 +401,7 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { T![;] } - struct ImplDef: TypeParamsOwner, AttrsOwner { + struct ImplDef: TypeParamsOwner, AttrsOwner, DocCommentsOwner { T![default], T![const], T![unsafe],