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

Method visit_for_calls_and_structure

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

Source from the content-addressed store, hash-verified

360 }
361
362 fn visit_for_calls_and_structure(&mut self, node: Node<'t>) {
363 let kind = node.kind();
364 self.maybe_capture_fn_refs(node);
365
366 if kind == "call" {
367 self.extract_call(node);
368 }
369
370 // Nested NAMED functions become their own nodes.
371 if kind == "function_definition" {
372 let name = self.extract_name(node);
373 if name != "<anonymous>" {
374 self.extract_function(node);
375 return;
376 }
377 }
378 if kind == "class_definition" {
379 self.extract_class(node);
380 return;
381 }
382
383 for i in 0..node.named_child_count() {
384 if let Some(c) = node.named_child(i) {
385 self.visit_for_calls_and_structure(c);
386 }
387 }
388 }
389
390 // --- extractors --------------------------------------------------------------
391

Callers 1

visit_function_bodyMethod · 0.45

Calls 5

maybe_capture_fn_refsMethod · 0.45
extract_callMethod · 0.45
extract_nameMethod · 0.45
extract_functionMethod · 0.45
extract_classMethod · 0.45

Tested by

no test coverage detected