extractName incl. the resolveName hook: a multi-segment extension name (`extension KF.Builder`) takes the LAST type_identifier's text.
(&self, node: Node)
| 498 | /// extractName incl. the resolveName hook: a multi-segment extension name |
| 499 | /// (`extension KF.Builder`) takes the LAST type_identifier's text. |
| 500 | fn extract_name(&self, node: Node) -> String { |
| 501 | if node.kind() == "class_declaration" { |
| 502 | if let Some(name_node) = node.child_by_field_name("name") { |
| 503 | if name_node.kind() == "user_type" { |
| 504 | let ids: Vec<Node> = (0..name_node.named_child_count()) |
| 505 | .filter_map(|i| name_node.named_child(i)) |
| 506 | .filter(|c| c.kind() == "type_identifier") |
| 507 | .collect(); |
| 508 | if ids.len() > 1 { |
| 509 | return self.text(ids[ids.len() - 1]).to_string(); |
| 510 | } |
| 511 | } |
| 512 | } |
| 513 | } |
| 514 | if let Some(name_node) = node.child_by_field_name("name") { |
| 515 | return self.text(name_node).to_string(); |
| 516 | } |
| 517 | for c in node.named_children(&mut node.walk()) { |
| 518 | if matches!(c.kind(), "identifier" | "type_identifier" | "simple_identifier" | "constant") { |
| 519 | return self.text(c).to_string(); |
| 520 | } |
| 521 | } |
| 522 | "<anonymous>".to_string() |
| 523 | } |
| 524 | |
| 525 | /// getVisibility: whole-text substring matching over `modifiers` children; |
| 526 | /// default INTERNAL. `open` → internal, `fileprivate` → private (via the |
no test coverage detected