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

Method extract_call_name

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

Source from the content-addressed store, hash-verified

726 }
727
728 fn extract_call_name(&self, func_node: &Node, source: &str) -> Option<String> {
729 match func_node.kind() {
730 "identifier" => {
731 let name = self.node_text(func_node, source);
732 if name.is_empty() {
733 None
734 } else {
735 Some(name)
736 }
737 }
738 "field_expression" => {
739 // obj.method() or ptr->method() — extract just the member name
740 func_node
741 .child_by_field_name("field")
742 .map(|f| self.node_text(&f, source))
743 .filter(|s| !s.is_empty())
744 }
745 "scoped_identifier" => {
746 // Namespace::func() — extract just "func"
747 func_node
748 .child_by_field_name("name")
749 .map(|n| self.node_text(&n, source))
750 .filter(|s| !s.is_empty())
751 }
752 _ => None,
753 }
754 }
755}
756
757impl Default for CppParser {

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