| 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 | |
| 633 | impl Default for JavaParser { |