(&mut self, node: Node<'t>)
| 448 | // --- extractors -------------------------------------------------------------- |
| 449 | |
| 450 | fn extract_function(&mut self, node: Node<'t>) { |
| 451 | // (getReceiverType only matches method_declaration's receiver field — |
| 452 | // function_declaration has none, so no reroute happens here) |
| 453 | let name = self.extract_name(node); |
| 454 | if name == "<anonymous>" { |
| 455 | if let Some(body) = node.child_by_field_name("body") { |
| 456 | self.visit_function_body(body); |
| 457 | } |
| 458 | return; |
| 459 | } |
| 460 | let extra = Extra { |
| 461 | docstring: preceding_docstring(node, self.src), |
| 462 | signature: self.signature_of(node), |
| 463 | is_exported: Some(self.is_exported(node)), |
| 464 | return_type: self.return_type_of(node), |
| 465 | ..Extra::default() |
| 466 | }; |
| 467 | let Some(row) = self.create_node("function", &name, node, extra) else { return }; |
| 468 | self.extract_type_annotations(node, row); |
| 469 | self.stack.push(Scope { row, kind: "function", name }); |
| 470 | if let Some(body) = node.child_by_field_name("body") { |
| 471 | self.visit_function_body(body); |
| 472 | } |
| 473 | self.stack.pop(); |
| 474 | } |
| 475 | |
| 476 | fn extract_method(&mut self, node: Node<'t>) { |
| 477 | // methodsAreTopLevel: always a method. Receiver-qualified name + |
no test coverage detected