Parse source code and extract all entities
(&mut self, source: &str, file_path: &str)
| 47 | |
| 48 | /// Parse source code and extract all entities |
| 49 | pub fn extract(&mut self, source: &str, file_path: &str) -> Vec<Entity> { |
| 50 | let tree = match self.parser.parse(source, None) { |
| 51 | Some(t) => t, |
| 52 | None => return vec![], |
| 53 | }; |
| 54 | |
| 55 | self.extract_from_tree(&tree, source, file_path) |
| 56 | } |
| 57 | |
| 58 | /// Annotate the same tree used by shared semantic source analysis. |
| 59 | pub fn extract_from_tree( |