#![allow(clippy::disallowed_types)]
use corsa::api::{CapabilitiesResponse, ProjectSession};
use lsp_types::Diagnostic;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::path::PathBuf;
use std::sync::Arc;
use vize_carton::{FxHashMap, String};
mod bootstrap;
mod diagnostics;
mod diagnostics_api;
mod lifecycle;
pub(crate) mod paths;
mod queries;
mod session;
mod utils;
#[cfg(test)]
mod tests;
pub struct CorsaProjectClient {
executable: String,
cwd: PathBuf,
session: ProjectSession,
capabilities: Arc<CapabilitiesResponse>,
project_root: PathBuf,
pub(crate) diagnostics: FxHashMap<String, Vec<Diagnostic>>,
overlay_versions: FxHashMap<String, i32>,
document_texts: FxHashMap<String, String>,
session_document_uris: FxHashMap<String, String>,
external_document_uris: FxHashMap<String, String>,
temp_dir: Option<PathBuf>,
closed: bool,
}
pub type CorsaLspClient = CorsaProjectClient;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LspDiagnostic {
pub range: LspRange,
pub severity: Option<i32>,
pub code: Option<Value>,
pub source: Option<String>,
pub message: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LspRange {
pub start: LspPosition,
pub end: LspPosition,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LspPosition {
pub line: u32,
pub character: u32,
}
pub(crate) struct DiagnosticFetch {
pub(crate) diagnostics: Vec<Diagnostic>,
pub(crate) used_cache: bool,
}