extractName — the zero-field grammar means the nameField lookup always misses; names come from the shared fallback scan (first direct identifier-family child; backtick names keep their backticks).
(&self, node: Node)
| 582 | /// misses; names come from the shared fallback scan (first direct |
| 583 | /// identifier-family child; backtick names keep their backticks). |
| 584 | fn extract_name(&self, node: Node) -> String { |
| 585 | if let Some(name_node) = node.child_by_field_name("simple_identifier") { |
| 586 | // nameField is a TYPE name used as a FIELD name — never resolves |
| 587 | // (mirrored for shape; the grammar has zero fields). |
| 588 | return self.text(name_node).to_string(); |
| 589 | } |
| 590 | for c in node.named_children(&mut node.walk()) { |
| 591 | if matches!(c.kind(), "identifier" | "type_identifier" | "simple_identifier" | "constant") { |
| 592 | return self.text(c).to_string(); |
| 593 | } |
| 594 | } |
| 595 | "<anonymous>".to_string() |
| 596 | } |
| 597 | |
| 598 | /// getVisibility: modifiers text includes public/private/protected/ |
| 599 | /// internal in that order; default PUBLIC. Text-includes semantics — |
no test coverage detected