1use aether_lspd::{ClientError, UriError};
4use thiserror::Error;
5
6#[doc = include_str!("../docs/lsp_error.md")]
7#[derive(Debug, Error)]
8pub enum LspError {
9 #[error("I/O error: {0}")]
11 Io(#[from] std::io::Error),
12
13 #[error(transparent)]
15 Client(#[from] ClientError),
16
17 #[error("Language server unavailable: {0}")]
19 ServerUnavailable(String),
20
21 #[error("No LSP configured for {0}")]
23 UnsupportedLanguage(String),
24
25 #[error("Invalid path: {0}")]
27 InvalidPath(String),
28
29 #[error("Symbol not found: {0}")]
31 SymbolNotFound(String),
32
33 #[error("Invalid source position: {0}")]
35 InvalidPosition(String),
36
37 #[error("Invalid edit: {0}")]
39 InvalidEdit(String),
40}
41
42impl From<UriError> for LspError {
43 fn from(error: UriError) -> Self {
44 Self::InvalidPath(error.to_string())
45 }
46}