(&mut self, node: Node<'t>)
| 648 | // --- the dispatcher (visitNode, Kotlin-relevant branches) ----------------------- |
| 649 | |
| 650 | fn visit_node(&mut self, node: Node<'t>) { |
| 651 | if self.try_visit_hook(node) { |
| 652 | self.scan_fn_ref_subtree(node, 0); |
| 653 | return; |
| 654 | } |
| 655 | |
| 656 | let kind = node.kind(); |
| 657 | let mut skip_children = false; |
| 658 | |
| 659 | self.maybe_capture_fn_refs(node); |
| 660 | |
| 661 | if kind == "function_declaration" { |
| 662 | if self.inside_class_like() { |
| 663 | self.extract_method(node); |
| 664 | } else { |
| 665 | self.extract_function(node); |
| 666 | } |
| 667 | skip_children = true; |
| 668 | } else if kind == "class_declaration" { |
| 669 | // classifyClassNode: `interface`/`enum` keyword children. |
| 670 | let mut classified = "class"; |
| 671 | for i in 0..node.child_count() { |
| 672 | if let Some(c) = node.child(i) { |
| 673 | if c.kind() == "interface" { |
| 674 | classified = "interface"; |
| 675 | break; |
| 676 | } |
| 677 | if c.kind() == "enum" { |
| 678 | classified = "enum"; |
| 679 | break; |
| 680 | } |
| 681 | } |
| 682 | } |
| 683 | match classified { |
| 684 | "interface" => self.extract_interface(node), |
| 685 | "enum" => self.extract_enum(node), |
| 686 | _ => self.extract_class(node), |
| 687 | } |
| 688 | skip_children = true; |
| 689 | } else if kind == "object_declaration" { |
| 690 | // extraClassNodeTypes → extractClass → kind `class`. |
| 691 | self.extract_class(node); |
| 692 | skip_children = true; |
| 693 | } else if kind == "type_alias" { |
| 694 | skip_children = self.extract_type_alias(node); |
| 695 | } else if kind == "property_declaration" { |
| 696 | // Hook-declined destructuring: extractField/extractVariable both |
| 697 | // find no matching children for kotlin — NOTHING minted, RHS |
| 698 | // invisible; candidates-only scan. |
| 699 | self.scan_fn_ref_subtree(node, 0); |
| 700 | skip_children = true; |
| 701 | } else if kind == "import_header" { |
| 702 | self.extract_import(node); |
| 703 | } else if kind == "call_expression" { |
| 704 | self.extract_call(node); |
| 705 | } |
| 706 | // companion_object, anonymous_initializer, secondary_constructor, |
| 707 | // getter/setter siblings, file_annotation, object_literal, if/when at |
no test coverage detected