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

Method _load_existing_graph

rust-core/src/codegraph/parser.rs:899–916  ·  view source on GitHub ↗

尝试从本地数据库加载现有的图

(&self, dir: &Path)

Source from the content-addressed store, hash-verified

897
898 /// 尝试从本地数据库加载现有的图
899 fn _load_existing_graph(&self, dir: &Path) -> Result<Option<PetCodeGraph>, String> {
900 use crate::storage::PersistenceManager;
901
902 // 使用项目路径作为项目ID
903 let project_id = dir.file_name()
904 .and_then(|n| n.to_str())
905 .unwrap_or("default");
906
907 let persistence = PersistenceManager::new();
908 match persistence.load_graph(project_id) {
909 Ok(Some(graph)) => Ok(Some(graph)),
910 Ok(None) => Ok(None),
911 Err(e) => {
912 warn!("Failed to load existing graph: {}", e);
913 Ok(None)
914 }
915 }
916 }
917
918 /// 加载文件哈希值
919 fn _load_file_hashes(&self, dir: &Path) -> Result<HashMap<String, String>, String> {

Callers 1

Calls 1

load_graphMethod · 0.80

Tested by

no test coverage detected