Skip to content

Add documents owner for ImplDef and SourceFile #4280

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
May 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/ra_syntax/src/ast/generated/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Module> { support::children(&self.syntax) }
}
Expand Down Expand Up @@ -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<SyntaxToken> { support::token(&self.syntax, T![default]) }
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
Expand Down
4 changes: 2 additions & 2 deletions xtask/src/ast_src.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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],
}

Expand Down Expand Up @@ -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],
Expand Down