From 9bfdab7089429bd6f43d1e2683598d40eb476c2a Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Thu, 4 Jul 2019 14:57:14 -0400 Subject: Update to lsp-types 0.58.0 --- crates/gen_lsp_server/Cargo.toml | 2 +- crates/ra_lsp_server/Cargo.toml | 2 +- crates/ra_lsp_server/src/main_loop/handlers.rs | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'crates') diff --git a/crates/gen_lsp_server/Cargo.toml b/crates/gen_lsp_server/Cargo.toml index d14bcf694..bf57df81f 100644 --- a/crates/gen_lsp_server/Cargo.toml +++ b/crates/gen_lsp_server/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" description = "Generic LSP server scaffold." [dependencies] -lsp-types = "0.57.0" +lsp-types = "0.58.0" log = "0.4.3" serde_json = "1.0.34" serde = { version = "1.0.83", features = ["derive"] } diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml index 4491b8590..2c4b3789e 100644 --- a/crates/ra_lsp_server/Cargo.toml +++ b/crates/ra_lsp_server/Cargo.toml @@ -13,7 +13,7 @@ crossbeam-channel = "0.3.5" flexi_logger = "0.13.0" log = "0.4.3" url_serde = "0.2.0" -lsp-types = { version = "0.57.1", features = ["proposed"] } +lsp-types = { version = "0.58.0", features = ["proposed"] } rustc-hash = "1.0" parking_lot = "0.8.0" diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index bbbc93b1c..aea94ad0d 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -2,7 +2,7 @@ use std::{fmt::Write as _, io::Write as _}; use gen_lsp_server::ErrorCode; use lsp_types::{ - CodeAction, CodeActionResponse, CodeLens, Command, Diagnostic, DiagnosticSeverity, + CodeAction, CodeActionOrCommand, CodeActionResponse, CodeLens, Command, Diagnostic, DiagnosticSeverity, DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange, FoldingRangeKind, FoldingRangeParams, Hover, HoverContents, Location, MarkupContent, MarkupKind, Position, PrepareRenameResponse, Range, RenameParams, SymbolInformation, TextDocumentIdentifier, @@ -665,7 +665,7 @@ pub fn handle_code_action( let assists = world.analysis().assists(FileRange { file_id, range })?.into_iter(); let diagnostics = world.analysis().diagnostics(file_id)?; - let mut res: Vec = Vec::new(); + let mut res: CodeActionResponse = Default::default(); let fixes_from_diagnostics = diagnostics .into_iter() @@ -689,7 +689,7 @@ pub fn handle_code_action( edit: None, command: Some(command), }; - res.push(action); + res.push(CodeActionOrCommand::CodeAction(action)); } for assist in assists { @@ -711,10 +711,10 @@ pub fn handle_code_action( edit: None, command: Some(command), }; - res.push(action); + res.push(CodeActionOrCommand::CodeAction(action)); } - Ok(Some(CodeActionResponse::Actions(res))) + Ok(Some(res)) } pub fn handle_code_lens( -- cgit v1.2.3