Skip to content

Commit

Permalink
chore: field export
Browse files Browse the repository at this point in the history
  • Loading branch information
williamfzc committed Jan 4, 2025
1 parent a3df912 commit 3efc419
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct FileMetadata {

#[derive(Serialize, Deserialize, Clone)]
#[pyclass]
enum LineKind {
pub enum LineKind {
FileNode,
FileRelation,
SymbolNode,
Expand All @@ -48,28 +48,51 @@ enum LineKind {
#[derive(Serialize, Deserialize, Clone)]
#[pyclass]
pub struct FileNode {
#[pyo3(get)]
id: usize,

#[pyo3(get)]
kind: LineKind,

#[pyo3(get)]
name: String,

#[pyo3(get)]
issues: Vec<String>,
}

#[derive(Serialize, Deserialize, Clone)]
#[pyclass]
pub struct FileRelation {
#[pyo3(get)]
id: usize,

#[pyo3(get)]
kind: LineKind,

#[pyo3(get)]
src: usize,

#[pyo3(get)]
dst: usize,

#[pyo3(get)]
symbols: Vec<usize>,
}

#[derive(Serialize, Deserialize, Clone)]
#[pyclass]
pub struct SymbolNode {
#[pyo3(get)]
id: usize,

#[pyo3(get)]
kind: LineKind,

#[pyo3(get)]
name: String,

#[pyo3(get)]
range: RangeWrapper,
}

Expand Down

0 comments on commit 3efc419

Please sign in to comment.