You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/lsp-ai/src/config.rs
+27-19Lines changed: 27 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,21 @@
1
-
use anyhow::{Context,Result};
2
1
use serde::{Deserialize,Serialize};
3
2
use serde_json::Value;
4
3
use std::collections::HashMap;
5
4
5
+
#[derive(thiserror::Error,Debug)]
6
+
pub(crate)enumConfigError{
7
+
#[error("completion is disabled")]
8
+
CompletionDisabled,
9
+
#[error("`{0}` model not found in `models` config")]
10
+
ModelNotFound(String),
11
+
#[error("lsp-ai does not currently provide a default configuration. Please pass a configuration. See https://github.com/SilasMarvin/lsp-ai for configuration options and examples")]
12
+
NoDefaultConfig,
13
+
#[error("server configuration must be a valid JSON object")]
None => anyhow::bail!("lsp-ai does not currently provide a default configuration. Please pass a configuration. See https://github.com/SilasMarvin/lsp-ai for configuration options and examples"),
339
+
None => returnErr(ConfigError::NoDefaultConfig),
327
340
};
328
341
let client_params:ValidClientParams = serde_json::from_value(args)?;
0 commit comments