use serde::{Deserialize, Serialize};
pub mod initialization;
pub mod jsonrpc;
pub mod lsp;
pub use initialization::*;
pub use jsonrpc::*;
pub use lsp::*;
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(untagged)]
pub enum Id {
Number(i64),
String(String),
}
impl From<i64> for Id {
fn from(value: i64) -> Self {
Id::Number(value)
}
}
impl From<String> for Id {
fn from(value: String) -> Self {
Id::String(value)
}
}
impl From<&str> for Id {
fn from(value: &str) -> Self {
Id::String(value.to_string())
}
}
impl std::fmt::Display for Id {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Id::Number(n) => write!(f, "{}", n),
Id::String(s) => write!(f, "{}", s),
}
}
}
pub type ProgressToken = Id;
pub type Uri = String;
pub type DocumentUri = Uri;