Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/tests/sourcegen_ast.rs')
| -rw-r--r-- | crates/syntax/src/tests/sourcegen_ast.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/crates/syntax/src/tests/sourcegen_ast.rs b/crates/syntax/src/tests/sourcegen_ast.rs index c66edadc3c..ac928402f3 100644 --- a/crates/syntax/src/tests/sourcegen_ast.rs +++ b/crates/syntax/src/tests/sourcegen_ast.rs @@ -777,6 +777,33 @@ fn extract_struct_traits(ast: &mut AstSrc) { extract_struct_trait(node, name, methods); } } + + let nodes_with_doc_comments = [ + "SourceFile", + "Fn", + "Struct", + "Union", + "RecordField", + "TupleField", + "Enum", + "Variant", + "Trait", + "Module", + "Static", + "Const", + "TypeAlias", + "Impl", + "MacroRules", + "MacroDef", + "Macro", + "Use", + ]; + + for node in &mut ast.nodes { + if nodes_with_doc_comments.contains(&&*node.name) { + node.traits.push("HasDocComments".into()); + } + } } fn extract_struct_trait(node: &mut AstNodeSrc, trait_name: &str, methods: &[&str]) { |