minor: bump lsp-server version

This commit is contained in:
Lukas Wirth 2022-04-09 00:13:47 +02:00
parent b8ed4a388c
commit 2d445de170
4 changed files with 13 additions and 5 deletions

4
Cargo.lock generated
View File

@ -869,9 +869,9 @@ dependencies = [
[[package]]
name = "lsp-server"
version = "0.5.2"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c351c75989da23b355226dc188dc2b52538a7f4f218d70fd7393c6b62b110444"
checksum = "f70570c1c29cf6654029b8fe201a5507c153f0d85be6f234d471d756bc36775a"
dependencies = [
"crossbeam-channel",
"log",

View File

@ -33,7 +33,7 @@ threadpool = "1.8.1"
rayon = "1.5.1"
num_cpus = "1.13.1"
mimalloc = { version = "0.1.28", default-features = false, optional = true }
lsp-server = "0.5.2"
lsp-server = "0.6.0"
tracing = "0.1.32"
tracing-subscriber = { version = "0.3.9", default-features = false, features = [
"env-filter",

View File

@ -1,6 +1,7 @@
//! See [RequestDispatcher].
use std::{fmt, panic, thread};
use lsp_server::ExtractError;
use serde::{de::DeserializeOwned, Serialize};
use crate::{
@ -234,7 +235,10 @@ pub(crate) fn on<N>(
};
let params = match not.extract::<N::Params>(N::METHOD) {
Ok(it) => it,
Err(not) => {
Err(ExtractError::JsonError { method, error }) => {
panic!("Invalid request\nMethod: {method}\n error: {error}",)
}
Err(ExtractError::MethodMismatch(not)) => {
self.not = Some(not);
return Ok(self);
}

View File

@ -256,7 +256,11 @@ pub(crate) fn send_request<R: lsp_types::request::Request>(
self.send(request.into());
}
pub(crate) fn complete_request(&mut self, response: lsp_server::Response) {
let handler = self.req_queue.outgoing.complete(response.id.clone());
let handler = self
.req_queue
.outgoing
.complete(response.id.clone())
.expect("received response for unknown request");
handler(self, response)
}