diff --git a/src/api.rs b/src/api.rs index d34cea0..82d50fd 100644 --- a/src/api.rs +++ b/src/api.rs @@ -21,6 +21,12 @@ pub struct RelatedFileContext { #[derive(Serialize, Deserialize)] #[pyclass] pub struct FileMetadata { + #[pyo3(get)] + pub path: String, + + #[pyo3(get)] + pub commits: Vec, + #[pyo3(get)] pub symbols: Vec, } @@ -123,7 +129,13 @@ impl Graph { .iter() .cloned() .collect(); - FileMetadata { symbols } + + let commit_sha_list = self._relation_graph.file_related_commits(&file_name).unwrap_or_default(); + FileMetadata { + path: file_name, + commits: commit_sha_list, + symbols + } } pub fn pairs_between_files(&self, src_file: String, dst_file: String) -> Vec {