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

Method extract_call_name

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

Source from the content-addressed store, hash-verified

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