MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / extract_call_name

Method extract_call_name

atomic-semantic/src/parsers/python.rs:387–406  ·  view source on GitHub ↗
(&self, func_node: &Node, source: &str)

Source from the content-addressed store, hash-verified

385 }
386
387 fn extract_call_name(&self, func_node: &Node, source: &str) -> Option<String> {
388 match func_node.kind() {
389 "identifier" => {
390 let name = self.node_text(func_node, source);
391 if name.is_empty() {
392 None
393 } else {
394 Some(name)
395 }
396 }
397 "attribute" => {
398 // obj.method() — extract just "method"
399 func_node
400 .child_by_field_name("attribute")
401 .map(|f| self.node_text(&f, source))
402 .filter(|s| !s.is_empty())
403 }
404 _ => None,
405 }
406 }
407}
408
409impl Default for PythonParser {

Callers 1

walk_tree_for_callsMethod · 0.45

Calls 3

kindMethod · 0.45
node_textMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected