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