extractVariable's generic fallback: kind is ALWAYS `variable` (no isConst hook), every direct `identifier` child mints a node positioned at the CHILD, docstring shared, isExported present-false, no signature, and the initializer value is never body-walked.
(&mut self, node: Node<'t>)
| 649 | /// at the CHILD, docstring shared, isExported present-false, no signature, |
| 650 | /// and the initializer value is never body-walked. |
| 651 | fn extract_variable(&mut self, node: Node<'t>) { |
| 652 | let docstring = preceding_docstring(node, self.src); |
| 653 | for i in 0..node.named_child_count() { |
| 654 | let Some(child) = node.named_child(i) else { continue }; |
| 655 | if child.kind() != "identifier" { |
| 656 | continue; |
| 657 | } |
| 658 | let name = self.text(child).to_string(); |
| 659 | if !name.is_empty() { |
| 660 | self.create_node( |
| 661 | "variable", |
| 662 | &name, |
| 663 | child, |
| 664 | Extra { |
| 665 | docstring: docstring.clone(), |
| 666 | is_exported: Some(false), |
| 667 | ..Extra::default() |
| 668 | }, |
| 669 | ); |
| 670 | } |
| 671 | } |
| 672 | } |
| 673 | |
| 674 | /// extractImport via the rust hook: import node named by the ROOT module + |
| 675 | /// one generic root `imports` ref + per-binding FULL-path refs. |
no test coverage detected