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:579–627  ·  view source on GitHub ↗
(&mut self, node: Node<'t>)

Source from the content-addressed store, hash-verified

577 }
578
579 fn visit_for_calls_and_structure(&mut self, node: Node<'t>) {
580 stack_guard!();
581 let kind = node.kind();
582 self.maybe_capture_fn_refs(node);
583
584 if kind == "invocation_expression" {
585 self.extract_call(node);
586 } else if kind == "object_creation_expression" {
587 self.extract_instantiation(node);
588 if let Some(anon_body) = find_anonymous_class_body(node) {
589 self.extract_anonymous_class(node, anon_body);
590 return;
591 }
592 }
593
594 // Static value reads (`ReadType.ReadAsDouble`) — body walker only.
595 self.extract_static_member_ref(node);
596
597 // (variable_declarator type-annotation branch: C# has no
598 // `type_annotation` child node — structurally inert, not ported.
599 // functionTypes is empty — no nested-function branch.)
600
601 if kind == "class_declaration" || kind == "record_declaration" {
602 if kind == "record_declaration" && record_is_struct(node) {
603 self.extract_struct(node);
604 } else {
605 self.extract_class(node);
606 }
607 return;
608 }
609 if kind == "struct_declaration" || kind == "record_struct_declaration" {
610 self.extract_struct(node);
611 return;
612 }
613 if kind == "enum_declaration" {
614 self.extract_enum(node);
615 return;
616 }
617 if kind == "interface_declaration" {
618 self.extract_interface(node);
619 return;
620 }
621
622 for i in 0..node.named_child_count() {
623 if let Some(c) = node.named_child(i) {
624 self.visit_for_calls_and_structure(c);
625 }
626 }
627 }
628
629 // --- extractors --------------------------------------------------------------
630

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