extractFunction — only reachable for a method outside any class.
(&mut self, node: Node<'t>)
| 652 | |
| 653 | /// extractFunction — only reachable for a method outside any class. |
| 654 | fn extract_function(&mut self, node: Node<'t>) { |
| 655 | stack_guard!(); |
| 656 | let name = self.extract_name(node); |
| 657 | if name == "<anonymous>" { |
| 658 | if let Some(body) = node.child_by_field_name("body") { |
| 659 | self.visit_function_body(body); |
| 660 | } |
| 661 | return; |
| 662 | } |
| 663 | let extra = Extra { |
| 664 | docstring: preceding_docstring(node, self.src), |
| 665 | signature: self.signature_of(node), |
| 666 | visibility: self.visibility_of(node), |
| 667 | is_static: Some(self.is_static(node)), |
| 668 | return_type: self.normalize_java_type(node.child_by_field_name("type")), |
| 669 | ..Extra::default() |
| 670 | }; |
| 671 | let Some(row) = self.create_node("function", &name, node, extra) else { return }; |
| 672 | self.extract_type_annotations(node, row); |
| 673 | self.extract_decorators_for(node, row); |
| 674 | self.stack.push(Scope { row, kind: "function", name }); |
| 675 | if let Some(body) = node.child_by_field_name("body") { |
| 676 | self.visit_function_body(body); |
| 677 | } |
| 678 | self.stack.pop(); |
| 679 | } |
| 680 | |
| 681 | fn extract_interface(&mut self, node: Node<'t>) { |
| 682 | stack_guard!(); |
no test coverage detected