use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(tag = "kind", rename_all = "snake_case")]
pub enum QuickFix {
InsertText { label: String, line: usize, column: usize, text: String },
ApplyPatch { label: String, document_path: String, patches: Vec<serde_json::Value> },
RemoveLine { label: String, line: usize },
}
impl QuickFix {
pub fn encode(&self) -> Option<String> {
serde_json::to_string(self).ok()
}
pub fn decode(raw: &str) -> Option<Self> {
serde_json::from_str(raw).ok()
}
}