From 38cb934d8f579663ff13496bf79293103863b60b Mon Sep 17 00:00:00 2001 From: wojciechkepka Date: Fri, 18 Jun 2021 05:42:34 +0200 Subject: Add unique id to each lsp client/server pair --- helix-term/src/application.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'helix-term/src') diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index f5cba365..3f1d6a10 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -109,8 +109,8 @@ impl Application { event = reader.next() => { self.handle_terminal_events(event) } - Some(call) = self.editor.language_servers.incoming.next() => { - self.handle_language_server_message(call).await + Some((id, call)) = self.editor.language_servers.incoming.next() => { + self.handle_language_server_message(call, id).await } Some(callback) = &mut self.callbacks.next() => { self.handle_language_server_callback(callback) @@ -153,8 +153,12 @@ impl Application { } } - pub async fn handle_language_server_message(&mut self, call: helix_lsp::Call) { - use helix_lsp::{Call, Notification}; + pub async fn handle_language_server_message( + &mut self, + call: helix_lsp::Call, + server_id: usize, + ) { + use helix_lsp::{Call, MethodCall, Notification}; match call { Call::Notification(helix_lsp::jsonrpc::Notification { method, params, .. }) => { let notification = match Notification::parse(&method, params) { -- cgit v1.2.3-70-g09d2