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

Method extract_function

codegraph-kernel/src/csharp.rs:1057–1081  ·  view source on GitHub ↗

extractFunction — only reachable for a method outside any class (unreachable on non-erroring C#; kept faithful to the generic tail).

(&mut self, node: Node<'t>)

Source from the content-addressed store, hash-verified

1055 /// extractFunction — only reachable for a method outside any class
1056 /// (unreachable on non-erroring C#; kept faithful to the generic tail).
1057 fn extract_function(&mut self, node: Node<'t>) {
1058 stack_guard!();
1059 let name = self.extract_name(node);
1060 if name == "<anonymous>" {
1061 if let Some(body) = node.child_by_field_name("body") {
1062 self.visit_function_body(body);
1063 }
1064 return;
1065 }
1066 let extra = Extra {
1067 docstring: preceding_docstring(node, self.src),
1068 signature: None,
1069 visibility: Some(self.visibility_of(node)),
1070 is_async: Some(self.is_async(node)),
1071 is_static: Some(self.is_static(node)),
1072 return_type: self.return_type_of(node),
1073 };
1074 let Some(row) = self.create_node("function", &name, node, extra) else { return };
1075 self.extract_csharp_type_refs(node, row);
1076 self.stack.push(Scope { row, kind: "function", name });
1077 if let Some(body) = node.child_by_field_name("body") {
1078 self.visit_function_body(body);
1079 }
1080 self.stack.pop();
1081 }
1082
1083 fn extract_variable(&mut self, node: Node<'t>) {
1084 // extractVariable's generic fallback: direct identifier /

Callers 1

extract_methodMethod · 0.45

Calls 10

preceding_docstringFunction · 0.85
pushMethod · 0.80
extract_nameMethod · 0.45
visit_function_bodyMethod · 0.45
visibility_ofMethod · 0.45
is_asyncMethod · 0.45
is_staticMethod · 0.45
return_type_ofMethod · 0.45
create_nodeMethod · 0.45

Tested by

no test coverage detected