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

Method extract

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

Source from the content-addressed store, hash-verified

417 }
418
419 fn extract(&mut self, source: &str, file_path: &str) -> Vec<Entity> {
420 let tree = match self.parser.parse(source, None) {
421 Some(t) => t,
422 None => return vec![],
423 };
424
425 let mut entities = Vec::new();
426 self.walk_tree(&tree.root_node(), source, file_path, &mut entities, None);
427 entities
428 }
429
430 fn extract_references(&mut self, source: &str, file_path: &str) -> Vec<Reference> {
431 let tree = match self.parser.parse(source, None) {

Callers 15

test_extract_functionFunction · 0.45
test_extract_classFunction · 0.45
test_extract_importsFunction · 0.45
test_decorated_functionFunction · 0.45
test_decorated_classFunction · 0.45
test_empty_sourceFunction · 0.45
test_comment_onlyFunction · 0.45

Calls 2

parseMethod · 0.45
walk_treeMethod · 0.45

Tested by 15

test_extract_functionFunction · 0.36
test_extract_classFunction · 0.36
test_extract_importsFunction · 0.36
test_decorated_functionFunction · 0.36
test_decorated_classFunction · 0.36
test_empty_sourceFunction · 0.36
test_comment_onlyFunction · 0.36