(&self, node: Node)
| 411 | } |
| 412 | |
| 413 | fn extract_name(&self, node: Node) -> String { |
| 414 | if let Some(name_node) = node.child_by_field_name("name") { |
| 415 | return self.text(name_node).to_string(); |
| 416 | } |
| 417 | for c in node.named_children(&mut node.walk()) { |
| 418 | if matches!(c.kind(), "identifier" | "type_identifier" | "simple_identifier" | "constant") { |
| 419 | return self.text(c).to_string(); |
| 420 | } |
| 421 | } |
| 422 | "<anonymous>".to_string() |
| 423 | } |
| 424 | |
| 425 | // --- hooks (languages/php.ts) ------------------------------------------------ |
| 426 |
no test coverage detected