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

Method extract

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

Source from the content-addressed store, hash-verified

588 }
589
590 fn extract(&mut self, source: &str, file_path: &str) -> Vec<Entity> {
591 let tree = match self.parser.parse(source, None) {
592 Some(t) => t,
593 None => return vec![],
594 };
595
596 let mut entities = Vec::new();
597 self.walk_tree(&tree.root_node(), source, file_path, &mut entities, None);
598 entities
599 }
600
601 /// Extract all function call sites from a Rust source file.
602 ///

Callers 15

test_extract_functionFunction · 0.45
test_extract_structFunction · 0.45
test_extract_enumFunction · 0.45
test_extract_traitFunction · 0.45
test_extract_impl_blockFunction · 0.45
test_extract_trait_implFunction · 0.45
test_extract_type_aliasFunction · 0.45
test_extract_constFunction · 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_enumFunction · 0.36
test_extract_traitFunction · 0.36
test_extract_impl_blockFunction · 0.36
test_extract_trait_implFunction · 0.36
test_extract_type_aliasFunction · 0.36
test_extract_constFunction · 0.36