(&mut self, node: Node<'t>)
| 688 | } |
| 689 | |
| 690 | fn visit_for_calls_and_structure(&mut self, node: Node<'t>) { |
| 691 | stack_guard!(); |
| 692 | let kind = node.kind(); |
| 693 | self.maybe_capture_fn_refs(node); |
| 694 | |
| 695 | if kind == "call_expression" { |
| 696 | self.extract_call(node); |
| 697 | } else if kind == "new_expression" { |
| 698 | self.extract_instantiation(node); |
| 699 | } |
| 700 | |
| 701 | // Local variable type annotations (TS family only). |
| 702 | if self.variant.is_ts() && kind == "variable_declarator" { |
| 703 | let owner = self.top_row(); |
| 704 | self.extract_variable_type_annotation(node, owner); |
| 705 | } |
| 706 | |
| 707 | // Nested NAMED functions become their own nodes. |
| 708 | if is_function_type(kind) { |
| 709 | let name = self.extract_name(node); |
| 710 | if name != "<anonymous>" { |
| 711 | self.extract_function(node, None); |
| 712 | return; |
| 713 | } |
| 714 | } |
| 715 | |
| 716 | if is_class_type(self.variant, kind) { |
| 717 | self.extract_class(node); |
| 718 | return; |
| 719 | } |
| 720 | if self.variant.is_ts() && kind == "enum_declaration" { |
| 721 | self.extract_enum(node); |
| 722 | return; |
| 723 | } |
| 724 | if self.variant.is_ts() && kind == "interface_declaration" { |
| 725 | self.extract_interface(node); |
| 726 | return; |
| 727 | } |
| 728 | |
| 729 | for i in 0..node.named_child_count() { |
| 730 | if let Some(c) = node.named_child(i) { |
| 731 | self.visit_for_calls_and_structure(c); |
| 732 | } |
| 733 | } |
| 734 | } |
| 735 | |
| 736 | // --- name / signature / modifier helpers ------------------------------------ |
| 737 |
no test coverage detected