11940: minor: bump lsp-server version r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
bors[bot] 2022-04-08 22:14:48 +00:00 committed by GitHub
commit 399559e597
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 @@ impl<'a> NotificationDispatcher<'a> {
};
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 @@ impl GlobalState {
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)
}