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

Source from the content-addressed store, hash-verified

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

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