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

Source from the content-addressed store, hash-verified

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

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