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

Method visit_for_calls_and_structure

codegraph-kernel/src/csharp.rs:644–692  ·  view source on GitHub ↗
(&mut self, node: Node<'t>)

Source from the content-addressed store, hash-verified

642 }
643
644 fn visit_for_calls_and_structure(&mut self, node: Node<'t>) {
645 stack_guard!();
646 let kind = node.kind();
647 self.maybe_capture_fn_refs(node);
648
649 if kind == "invocation_expression" {
650 self.extract_call(node);
651 } else if kind == "object_creation_expression" {
652 self.extract_instantiation(node);
653 if let Some(anon_body) = find_anonymous_class_body(node) {
654 self.extract_anonymous_class(node, anon_body);
655 return;
656 }
657 }
658
659 // Static value reads (`ReadType.ReadAsDouble`) — body walker only.
660 self.extract_static_member_ref(node);
661
662 // (variable_declarator type-annotation branch: C# has no
663 // `type_annotation` child node — structurally inert, not ported.
664 // functionTypes is empty — no nested-function branch.)
665
666 if kind == "class_declaration" || kind == "record_declaration" {
667 if kind == "record_declaration" && record_is_struct(node) {
668 self.extract_struct(node);
669 } else {
670 self.extract_class(node);
671 }
672 return;
673 }
674 if kind == "struct_declaration" || kind == "record_struct_declaration" {
675 self.extract_struct(node);
676 return;
677 }
678 if kind == "enum_declaration" {
679 self.extract_enum(node);
680 return;
681 }
682 if kind == "interface_declaration" {
683 self.extract_interface(node);
684 return;
685 }
686
687 for i in 0..node.named_child_count() {
688 if let Some(c) = node.named_child(i) {
689 self.visit_for_calls_and_structure(c);
690 }
691 }
692 }
693
694 // --- extractors --------------------------------------------------------------
695

Callers 1

visit_function_bodyMethod · 0.45

Calls 11

record_is_structFunction · 0.85
maybe_capture_fn_refsMethod · 0.45
extract_callMethod · 0.45
extract_instantiationMethod · 0.45
extract_structMethod · 0.45
extract_classMethod · 0.45
extract_enumMethod · 0.45
extract_interfaceMethod · 0.45

Tested by

no test coverage detected