Skip to content

Commit 0e6b536

Browse files
committed
Rust: Extract documentation comments as attributes
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 612c2b22-3121-4c83-9656-bb0f4abb2a8a
1 parent c95a838 commit 0e6b536

249 files changed

Lines changed: 1465 additions & 1120 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎rust/ast-generator/src/main.rs‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ fn get_additional_fields(node_name: &str) -> Vec<FieldInfo> {
149149

150150
fn get_trait_fields(trait_name: &str) -> Vec<FieldInfo> {
151151
match trait_name {
152-
"HasAttrs" => vec![FieldInfo::list("attrs", "Attr")],
152+
"HasAttrs" => vec![FieldInfo::list("attrs", "AnyAttr")],
153153
"HasName" => vec![FieldInfo::optional("name", "Name")],
154154
"HasVisibility" => vec![FieldInfo::optional("visibility", "Visibility")],
155155
"HasGenericParams" => vec![
@@ -440,7 +440,11 @@ fn field_info_to_extractor_info(name: &str, field: &FieldInfo) -> ExtractorNodeF
440440
},
441441
FieldType::List(ty) => ExtractorNodeFieldInfo {
442442
name,
443-
method: field.name.clone(),
443+
method: if ty == "AnyAttr" {
444+
"attrs_with_doc".to_owned()
445+
} else {
446+
field.name.clone()
447+
},
444448
snake_case_ty: to_lower_snake_case(ty),
445449
list: true,
446450
..Default::default()

‎rust/extractor/src/generated/.generated.list‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)