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

Method extract

atomic-semantic/src/parser.rs:49–56  ·  view source on GitHub ↗

Parse source code and extract all entities

(&mut self, source: &str, file_path: &str)

Source from the content-addressed store, hash-verified

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(

Calls 2

parseMethod · 0.45
extract_from_treeMethod · 0.45