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

Method walk_tree_for_calls

atomic-semantic/src/parsers/java.rs:603–630  ·  view source on GitHub ↗
(
        &self,
        node: &Node,
        source: &str,
        file_path: &str,
        refs: &mut Vec<Reference>,
    )

Source from the content-addressed store, hash-verified

601 }
602
603 fn walk_tree_for_calls(
604 &self,
605 node: &Node,
606 source: &str,
607 file_path: &str,
608 refs: &mut Vec<Reference>,
609 ) {
610 if node.kind() == "method_invocation" {
611 if let Some(name_node) = node.child_by_field_name("name") {
612 let name = self.node_text(&name_node, source);
613 if !name.is_empty() {
614 refs.push(Reference {
615 symbol: name,
616 file: file_path.to_string(),
617 line: (node.start_position().row as u32) + 1,
618 column: Some(node.start_position().column as u32),
619 context: None,
620 confidence: Confidence::High,
621 });
622 }
623 }
624 }
625
626 let mut cursor = node.walk();
627 for child in node.children(&mut cursor) {
628 self.walk_tree_for_calls(&child, source, file_path, refs);
629 }
630 }
631}
632
633impl Default for JavaParser {

Callers 1

extract_referencesMethod · 0.45

Calls 6

walkMethod · 0.80
childrenMethod · 0.80
kindMethod · 0.45
node_textMethod · 0.45
is_emptyMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected