summaryrefslogtreecommitdiff
path: root/cli/lsp/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/lsp/config.rs')
-rw-r--r--cli/lsp/config.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs
index fc3f030c9..b689275ef 100644
--- a/cli/lsp/config.rs
+++ b/cli/lsp/config.rs
@@ -1,10 +1,12 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-use deno_core::error::AnyError;
use deno_core::serde::Deserialize;
use deno_core::serde_json;
use deno_core::serde_json::Value;
use deno_core::url::Url;
+use lspower::jsonrpc::Error as LSPError;
+use lspower::jsonrpc::Result as LSPResult;
+use lspower::lsp_types;
#[derive(Debug, Clone, Default)]
pub struct ClientCapabilities {
@@ -29,8 +31,9 @@ pub struct Config {
}
impl Config {
- pub fn update(&mut self, value: Value) -> Result<(), AnyError> {
- let settings: WorkspaceSettings = serde_json::from_value(value)?;
+ pub fn update(&mut self, value: Value) -> LSPResult<()> {
+ let settings: WorkspaceSettings = serde_json::from_value(value)
+ .map_err(|err| LSPError::invalid_params(err.to_string()))?;
self.settings = settings;
Ok(())
}