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