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

Method extract_call_name

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

Source from the content-addressed store, hash-verified

359 }
360
361 fn extract_call_name(&self, func_node: &Node, source: &str) -> Option<String> {
362 match func_node.kind() {
363 "identifier" => {
364 let name = self.node_text(func_node, source);
365 if name.is_empty() {
366 None
367 } else {
368 Some(name)
369 }
370 }
371 "selector_expression" => {
372 // pkg.Func() or receiver.Method() — extract just the function/method name
373 func_node
374 .child_by_field_name("field")
375 .map(|f| self.node_text(&f, source))
376 .filter(|s| !s.is_empty())
377 }
378 _ => None,
379 }
380 }
381}
382
383impl Default for GoParser {

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