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

Method refresh_file

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

增量更新单个文件

(&mut self, file_path: &PathBuf)

Source from the content-addressed store, hash-verified

69
70 /// 增量更新单个文件
71 pub fn refresh_file(&mut self, file_path: &PathBuf) -> Result<(), String> {
72 info!("Refreshing file: {}", file_path.display());
73
74 // 检查文件是否需要更新
75 if let Ok(needs_update) = self.incremental_manager.needs_update(file_path) {
76 if !needs_update {
77 debug!("File {} unchanged, skipping", file_path.display());
78 return Ok(());
79 }
80 }
81
82 // 使用解析器刷新文件
83 let mut entity_graph = self.entity_graph.write();
84 let mut call_graph = self.call_graph.write();
85
86 self.parser.refresh_file(file_path, &mut entity_graph, &mut call_graph)?;
87
88 // 更新统计信息
89 entity_graph.update_stats();
90 call_graph.update_stats();
91
92 info!("Successfully refreshed file: {}", file_path.display());
93 Ok(())
94 }
95
96 /// 批量更新多个文件
97 pub fn refresh_files(&mut self, file_paths: &[PathBuf]) -> Result<(), String> {

Callers 2

initializeMethod · 0.45
refresh_filesMethod · 0.45

Calls 2

needs_updateMethod · 0.80
update_statsMethod · 0.45

Tested by

no test coverage detected