aboutsummaryrefslogtreecommitdiff
path: root/crates/gen_lsp_server/examples/01_gen_lsp_server.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/gen_lsp_server/examples/01_gen_lsp_server.rs')
-rw-r--r--crates/gen_lsp_server/examples/01_gen_lsp_server.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/gen_lsp_server/examples/01_gen_lsp_server.rs b/crates/gen_lsp_server/examples/01_gen_lsp_server.rs
index 60c581075..bc497f74a 100644
--- a/crates/gen_lsp_server/examples/01_gen_lsp_server.rs
+++ b/crates/gen_lsp_server/examples/01_gen_lsp_server.rs
@@ -1,3 +1,5 @@
1use std::error::Error;
2
1use crossbeam_channel::{Sender, Receiver}; 3use crossbeam_channel::{Sender, Receiver};
2use lsp_types::{ 4use lsp_types::{
3 ServerCapabilities, InitializeParams, 5 ServerCapabilities, InitializeParams,
@@ -5,7 +7,7 @@ use lsp_types::{
5}; 7};
6use gen_lsp_server::{run_server, stdio_transport, handle_shutdown, RawMessage, RawResponse}; 8use gen_lsp_server::{run_server, stdio_transport, handle_shutdown, RawMessage, RawResponse};
7 9
8fn main() -> Result<(), failure::Error> { 10fn main() -> Result<(), Box<dyn Error + Sync + Send>> {
9 let (receiver, sender, io_threads) = stdio_transport(); 11 let (receiver, sender, io_threads) = stdio_transport();
10 run_server(ServerCapabilities::default(), receiver, sender, main_loop)?; 12 run_server(ServerCapabilities::default(), receiver, sender, main_loop)?;
11 io_threads.join()?; 13 io_threads.join()?;
@@ -16,7 +18,7 @@ fn main_loop(
16 _params: InitializeParams, 18 _params: InitializeParams,
17 receiver: &Receiver<RawMessage>, 19 receiver: &Receiver<RawMessage>,
18 sender: &Sender<RawMessage>, 20 sender: &Sender<RawMessage>,
19) -> Result<(), failure::Error> { 21) -> Result<(), Box<dyn Error + Sync + Send>> {
20 for msg in receiver { 22 for msg in receiver {
21 match msg { 23 match msg {
22 RawMessage::Request(req) => { 24 RawMessage::Request(req) => {