MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / visit_for_calls_and_structure

Method visit_for_calls_and_structure

codegraph-kernel/src/tsjs/mod.rs:688–731  ·  view source on GitHub ↗
(&mut self, node: Node<'t>)

Source from the content-addressed store, hash-verified

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

Callers 1

visit_function_bodyMethod · 0.45

Calls 13

is_function_typeFunction · 0.85
is_class_typeFunction · 0.85
is_tsMethod · 0.80
maybe_capture_fn_refsMethod · 0.45
extract_callMethod · 0.45
extract_instantiationMethod · 0.45
top_rowMethod · 0.45
extract_nameMethod · 0.45
extract_functionMethod · 0.45
extract_classMethod · 0.45
extract_enumMethod · 0.45

Tested by

no test coverage detected