diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-03 11:46:07 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-03 11:46:07 +0100 |
commit | baa35b02b2f1a197beec65bcd68f56ffb89abfa1 (patch) | |
tree | 5dc778bff97a6e7b0c29b1fb90abf3ee79a188dd /crates | |
parent | 76c2f4ef49d8fe89c1199899f9fe6289ddd95b6b (diff) | |
parent | f90fbaf6a6ce9d41f712001e0f430e2ba0c4fbe6 (diff) |
Merge #4280
4280: Add documents owner for ImplDef and SourceFile r=matklad a=edwin0cheng
When working on #3182, I found that `ImplDef` and `SourceFile` do not implemet `DocCommentsOwer` trait, and I tested it in `cargo doc` that `impl` could has some doc-comments.
I am not so sure about `SourceFile` case, but in theory if that file is a crate root, the doc comment of it should represent the whole crate documentation, right ?
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_syntax/src/ast/generated/nodes.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 5e844d5ae..c2cc25958 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 { | |||
12 | } | 12 | } |
13 | impl ast::ModuleItemOwner for SourceFile {} | 13 | impl ast::ModuleItemOwner for SourceFile {} |
14 | impl ast::AttrsOwner for SourceFile {} | 14 | impl ast::AttrsOwner for SourceFile {} |
15 | impl ast::DocCommentsOwner for SourceFile {} | ||
15 | impl SourceFile { | 16 | impl SourceFile { |
16 | pub fn modules(&self) -> AstChildren<Module> { support::children(&self.syntax) } | 17 | pub fn modules(&self) -> AstChildren<Module> { support::children(&self.syntax) } |
17 | } | 18 | } |
@@ -259,6 +260,7 @@ pub struct ImplDef { | |||
259 | } | 260 | } |
260 | impl ast::TypeParamsOwner for ImplDef {} | 261 | impl ast::TypeParamsOwner for ImplDef {} |
261 | impl ast::AttrsOwner for ImplDef {} | 262 | impl ast::AttrsOwner for ImplDef {} |
263 | impl ast::DocCommentsOwner for ImplDef {} | ||
262 | impl ImplDef { | 264 | impl ImplDef { |
263 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } | 265 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
264 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | 266 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |