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/ra_lsp_server/src/main_loop/handlers.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_lsp_server/src') 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 From ad4276ac057a940617e757f67c2d0d164599b6a6 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Thu, 4 Jul 2019 16:52:29 -0400 Subject: Change default() --- crates/ra_lsp_server/src/main_loop/handlers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_lsp_server/src') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index aea94ad0d..49c3055f3 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -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: CodeActionResponse = Default::default(); + let mut res = CodeActionResponse::default(); let fixes_from_diagnostics = diagnostics .into_iter() -- cgit v1.2.3 From a394c04bca984165836cc77ca7171cd49a5d437e Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Thu, 4 Jul 2019 16:58:52 -0400 Subject: Fix formatting --- crates/ra_lsp_server/src/main_loop/handlers.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_lsp_server/src') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 49c3055f3..846991f09 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -2,11 +2,11 @@ use std::{fmt::Write as _, io::Write as _}; use gen_lsp_server::ErrorCode; use lsp_types::{ - CodeAction, CodeActionOrCommand, CodeActionResponse, CodeLens, Command, Diagnostic, DiagnosticSeverity, - DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange, FoldingRangeKind, - FoldingRangeParams, Hover, HoverContents, Location, MarkupContent, MarkupKind, Position, - PrepareRenameResponse, Range, RenameParams, SymbolInformation, TextDocumentIdentifier, - TextEdit, WorkspaceEdit, + CodeAction, CodeActionOrCommand, CodeActionResponse, CodeLens, Command, Diagnostic, + DiagnosticSeverity, DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange, + FoldingRangeKind, FoldingRangeParams, Hover, HoverContents, Location, MarkupContent, + MarkupKind, Position, PrepareRenameResponse, Range, RenameParams, SymbolInformation, + TextDocumentIdentifier, TextEdit, WorkspaceEdit, }; use ra_ide_api::{ AssistId, Cancelable, FileId, FilePosition, FileRange, FoldKind, Query, RangeInfo, -- cgit v1.2.3