MCPcopy Create free account
hub / github.com/CodeBendKit/codeseek / initialize

Method initialize

rust-core/src/codegraph/repository.rs:47–68  ·  view source on GitHub ↗

初始化仓库分析

(&mut self)

Source from the content-addressed store, hash-verified

45
46 /// 初始化仓库分析
47 pub fn initialize(&mut self) -> Result<(), String> {
48 info!("Initializing repository analysis for: {}", self.repository_path.display());
49
50 // 扫描所有文件
51 let files = self.parser.scan_directory(&self.repository_path);
52 info!("Found {} files to analyze", files.len());
53
54 // 分析每个文件
55 for file_path in files {
56 if let Err(e) = self.refresh_file(&file_path) {
57 warn!("Failed to analyze file {}: {}", file_path.display(), e);
58 }
59 }
60
61 // 预热代码片段缓存
62 if let Err(e) = self.warm_snippet_cache() {
63 warn!("Failed to warm snippet cache: {}", e);
64 }
65
66 info!("Repository analysis completed");
67 Ok(())
68 }
69
70 /// 增量更新单个文件
71 pub fn refresh_file(&mut self, file_path: &PathBuf) -> Result<(), String> {

Callers 1

run_analyzeFunction · 0.80

Calls 3

scan_directoryMethod · 0.80
warm_snippet_cacheMethod · 0.80
refresh_fileMethod · 0.45

Tested by

no test coverage detected