//! Doc comment generation and source file rewriting.
//!
//! This module provides per-language doc comment formatting and (in future tasks)
//! source file rewriting for LLM-generated documentation.

pub mod formats;
pub mod rewriter;

use std::path::PathBuf;

use crate::language::Language;

/// Result from Phase 2 LLM doc generation.
/// Carries everything needed to write a doc comment back to a source file:
/// the target location, the generated text, and metadata for cache/idempotency.
#[derive(Debug, Clone)]
pub struct DocCommentResult {
    /// Path to the source file containing the function.
    pub file: PathBuf,
    /// Name of the function/method that needs documentation.
    pub function_name: String,
    /// Content hash of the chunk (for cache lookup and idempotency).
    pub content_hash: String,
    /// Raw doc text generated by the LLM (not yet formatted).
    pub generated_doc: String,
    /// Language of the source file (determines doc comment format).
    pub language: Language,
    /// 1-based line number where the function definition starts.
    pub line_start: usize,
    /// Whether the function already had a doc comment (thin doc replacement).
    pub had_existing_doc: bool,
}
