use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum ChunkKind {
    Function,
    Method,
    Class,
    Struct,
    Enum,
    Impl,
    Trait,
    Module,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Chunk {
    pub symbol: String,
    pub kind: ChunkKind,
    pub start_line: u32,
    pub end_line: u32,
    pub start_byte: u32,
    pub end_byte: u32,
    pub doc_comment: String,
    pub content: String,
    pub signature: String,
    /// Direct callees extracted during chunking using the already-parsed
    /// tree. Populated by `chunk_source`; empty for unrecognised languages.
    #[serde(default)]
    pub callees: Vec<String>,
}
