extractFunction — only reachable for a method outside any class.
(&mut self, node: Node<'t>)
| 627 | |
| 628 | /// extractFunction — only reachable for a method outside any class. |
| 629 | fn extract_function(&mut self, node: Node<'t>) { |
| 630 | let name = self.extract_name(node); |
| 631 | if name == "<anonymous>" { |
| 632 | if let Some(body) = node.child_by_field_name("body") { |
| 633 | self.visit_function_body(body); |
| 634 | } |
| 635 | return; |
| 636 | } |
| 637 | let extra = Extra { |
| 638 | docstring: preceding_docstring(node, self.src), |
| 639 | signature: self.signature_of(node), |
| 640 | visibility: self.visibility_of(node), |
| 641 | is_static: Some(self.is_static(node)), |
| 642 | return_type: self.normalize_java_type(node.child_by_field_name("type")), |
| 643 | ..Extra::default() |
| 644 | }; |
| 645 | let Some(row) = self.create_node("function", &name, node, extra) else { return }; |
| 646 | self.extract_type_annotations(node, row); |
| 647 | self.extract_decorators_for(node, row); |
| 648 | self.stack.push(Scope { row, kind: "function", name }); |
| 649 | if let Some(body) = node.child_by_field_name("body") { |
| 650 | self.visit_function_body(body); |
| 651 | } |
| 652 | self.stack.pop(); |
| 653 | } |
| 654 | |
| 655 | fn extract_interface(&mut self, node: Node<'t>) { |
| 656 | let name = self.extract_name(node); |
no test coverage detected