use serde::{Deserialize, Serialize};
use std::path::PathBuf;
#[derive(Debug, Clone, Deserialize)]
pub struct CompletionRequest {
pub file_path: PathBuf,
pub line: usize,
pub column: usize,
pub max_results: Option<usize>,
}
#[derive(Debug, Clone, Serialize)]
pub struct CompletionResponse {
pub suggestions: Vec<CompletionSuggestion>,
pub metadata: CompletionMetadata,
}
#[derive(Debug, Clone, Serialize)]
pub struct CompletionSuggestion {
pub label: String,
pub insert_text: String,
pub detail: String,
pub kind: SymbolKind,
pub score: f32,
pub source: SuggestionSource,
pub grounded_in: Vec<String>,
pub usage_count: usize,
pub last_used: Option<i64>,
pub source_file: Option<String>,
pub via_import: Option<String>,
}
#[derive(Debug, Clone, Serialize)]
pub enum SuggestionSource {
Database,
Imported,
Pattern,
Similarity,
Convention,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub enum SymbolKind {
Function,
Struct,
Enum,
Trait,
Impl,
Module,
Variable,
Constant,
TypeAlias,
Constructor,
}
#[derive(Debug, Clone, Serialize)]
pub struct CompletionMetadata {
pub query_time_ms: u64,
pub total_symbols_indexed: usize,
pub database_version: u32,
pub database_queries: usize,
}
#[derive(Debug, Clone)]
pub struct Symbol {
pub id: String,
pub name: String,
pub kind: SymbolKind,
pub path: String,
pub line: usize,
pub column: usize,
}