分析目录并构建代码图
(&mut self, dir: &Path)
| 23 | |
| 24 | /// 分析目录并构建代码图 |
| 25 | pub fn analyze_directory(&mut self, dir: &Path) -> Result<&CodeGraph, String> { |
| 26 | info!("Starting code graph analysis for directory: {}", dir.display()); |
| 27 | |
| 28 | let code_graph = self.parser.build_code_graph(dir)?; |
| 29 | self.code_graph = Some(code_graph); |
| 30 | |
| 31 | info!("Code graph analysis completed"); |
| 32 | Ok(self.code_graph.as_ref().unwrap()) |
| 33 | } |
| 34 | |
| 35 | /// 获取代码图 |
| 36 | pub fn get_code_graph(&self) -> Option<&CodeGraph> { |