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)
| 526 | /// misses; names come from the shared fallback scan (first direct |
| 527 | /// identifier-family child; backtick names keep their backticks). |
| 528 | fn extract_name(&self, node: Node) -> String { |
| 529 | if let Some(name_node) = node.child_by_field_name("simple_identifier") { |
| 530 | // nameField is a TYPE name used as a FIELD name — never resolves |
| 531 | // (mirrored for shape; the grammar has zero fields). |
| 532 | return self.text(name_node).to_string(); |
| 533 | } |
| 534 | for i in 0..node.named_child_count() { |
| 535 | if let Some(c) = node.named_child(i) { |
| 536 | if matches!(c.kind(), "identifier" | "type_identifier" | "simple_identifier" | "constant") { |
| 537 | return self.text(c).to_string(); |
| 538 | } |
| 539 | } |
| 540 | } |
| 541 | "<anonymous>".to_string() |
| 542 | } |
| 543 | |
| 544 | /// getVisibility: modifiers text includes public/private/protected/ |
| 545 | /// internal in that order; default PUBLIC. Text-includes semantics — |
no test coverage detected