(&self, node: Node)
| 311 | } |
| 312 | |
| 313 | fn extract_name(&self, node: Node) -> String { |
| 314 | if let Some(name_node) = node.child_by_field_name("name") { |
| 315 | return self.text(name_node).to_string(); |
| 316 | } |
| 317 | for i in 0..node.named_child_count() { |
| 318 | if let Some(c) = node.named_child(i) { |
| 319 | if matches!(c.kind(), "identifier" | "type_identifier" | "simple_identifier" | "constant") { |
| 320 | return self.text(c).to_string(); |
| 321 | } |
| 322 | } |
| 323 | } |
| 324 | "<anonymous>".to_string() |
| 325 | } |
| 326 | |
| 327 | /// goExtractor.getSignature: params + ' ' + result. |
| 328 | fn signature_of(&self, node: Node) -> Option<String> { |
no test coverage detected