mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Generate AnyHasDocComments
node
This commit is contained in:
parent
2fb6f5e46a
commit
69dbfc7754
6 changed files with 95 additions and 21 deletions
|
@ -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]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue