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

Source from the content-addressed store, hash-verified

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

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