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

Method extract

atomic-semantic/src/parsers/go.rs:394–403  ·  view source on GitHub ↗
(&mut self, source: &str, file_path: &str)

Source from the content-addressed store, hash-verified

392 }
393
394 fn extract(&mut self, source: &str, file_path: &str) -> Vec<Entity> {
395 let tree = match self.parser.parse(source, None) {
396 Some(t) => t,
397 None => return vec![],
398 };
399
400 let mut entities = Vec::new();
401 self.walk_tree(&tree.root_node(), source, file_path, &mut entities);
402 entities
403 }
404
405 fn extract_references(&mut self, source: &str, file_path: &str) -> Vec<Reference> {
406 let tree = match self.parser.parse(source, None) {

Callers 15

test_extract_functionFunction · 0.45
test_extract_structFunction · 0.45
test_extract_interfaceFunction · 0.45
test_extract_methodFunction · 0.45
test_extract_type_aliasFunction · 0.45
test_extract_constFunction · 0.45
test_extract_varFunction · 0.45
test_extract_importFunction · 0.45
test_empty_sourceFunction · 0.45
test_package_onlyFunction · 0.45

Calls 2

parseMethod · 0.45
walk_treeMethod · 0.45

Tested by 15

test_extract_functionFunction · 0.36
test_extract_structFunction · 0.36
test_extract_interfaceFunction · 0.36
test_extract_methodFunction · 0.36
test_extract_type_aliasFunction · 0.36
test_extract_constFunction · 0.36
test_extract_varFunction · 0.36
test_extract_importFunction · 0.36
test_empty_sourceFunction · 0.36
test_package_onlyFunction · 0.36