diff --git a/crates/gen_lsp_server/src/lib.rs b/crates/gen_lsp_server/src/lib.rs index e45a6b5e27c9..5c25ba3e5a02 100644 --- a/crates/gen_lsp_server/src/lib.rs +++ b/crates/gen_lsp_server/src/lib.rs @@ -18,8 +18,8 @@ //! let (receiver, sender, io_threads) = stdio_transport(); //! gen_lsp_server::run_server( //! ServerCapabilities::default(), -//! receiver, -//! sender, +//! &receiver, +//! &sender, //! main_loop, //! )?; //! io_threads.join()?; @@ -94,14 +94,14 @@ pub use { /// request. pub fn run_server( caps: ServerCapabilities, - receiver: Receiver, - sender: Sender, + receiver: &Receiver, + sender: &Sender, server: impl FnOnce(InitializeParams, &Receiver, &Sender) -> Result<()>, ) -> Result<()> { info!("lsp server initializes"); - let params = initialize(&receiver, &sender, caps)?; + let params = initialize(receiver, sender, caps)?; info!("lsp server initialized, serving requests"); - server(params, &receiver, &sender)?; + server(params, receiver, sender)?; info!("lsp server waiting for exit notification"); match receiver.recv() { Some(RawMessage::Notification(n)) => n diff --git a/crates/gen_lsp_server/src/msg.rs b/crates/gen_lsp_server/src/msg.rs index e0d0aeab55c8..e1b27c808ec2 100644 --- a/crates/gen_lsp_server/src/msg.rs +++ b/crates/gen_lsp_server/src/msg.rs @@ -94,7 +94,7 @@ impl RawRequest { R::Params: Serialize, { RawRequest { - id: id, + id, method: R::METHOD.to_string(), params: to_value(params).unwrap(), } diff --git a/crates/ra_lsp_server/src/main.rs b/crates/ra_lsp_server/src/main.rs index c07eb01404dc..708bfe24ead3 100644 --- a/crates/ra_lsp_server/src/main.rs +++ b/crates/ra_lsp_server/src/main.rs @@ -35,8 +35,8 @@ fn main_inner() -> Result<()> { let cwd = ::std::env::current_dir()?; run_server( ra_lsp_server::server_capabilities(), - receiver, - sender, + &receiver, + &sender, |params, r, s| { let root = params .root_uri diff --git a/crates/ra_lsp_server/src/main_loop/mod.rs b/crates/ra_lsp_server/src/main_loop/mod.rs index 2623ab84ed94..17d30aba8688 100644 --- a/crates/ra_lsp_server/src/main_loop/mod.rs +++ b/crates/ra_lsp_server/src/main_loop/mod.rs @@ -81,6 +81,7 @@ pub fn main_loop( Ok(()) } +#[cfg_attr(feature = "cargo-clippy", allow(clippy::too_many_arguments))] fn main_loop_inner( internal_mode: bool, ws_root: PathBuf,