Annotate the same tree used by shared semantic source analysis.
(
&self,
tree: &tree_sitter::Tree,
source: &str,
file_path: &str,
)
| 57 | |
| 58 | /// Annotate the same tree used by shared semantic source analysis. |
| 59 | pub fn extract_from_tree( |
| 60 | &self, |
| 61 | tree: &tree_sitter::Tree, |
| 62 | source: &str, |
| 63 | file_path: &str, |
| 64 | ) -> Vec<Entity> { |
| 65 | let mut entities = Vec::new(); |
| 66 | self.walk_tree(&tree.root_node(), source, file_path, &mut entities, false); |
| 67 | entities |
| 68 | } |
| 69 | |
| 70 | /// Parse source code and extract all references (function calls, variable usages) |
| 71 | pub fn extract_references(&mut self, source: &str, file_path: &str) -> Vec<Reference> { |