From 73836cdbbc928f3512156f0bc0166e5a39ad9864 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 20 Jan 2019 21:05:01 +0300 Subject: extend selection expands macros and can totally panic --- crates/ra_lsp_server/src/main_loop/handlers.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'crates/ra_lsp_server') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 5cd8abbb9..02393f728 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -8,7 +8,7 @@ use lsp_types::{ WorkspaceEdit }; use ra_ide_api::{ - FileId, FilePosition, FileRange, FoldKind, Query, RangeInfo, RunnableKind, Severity, + FileId, FilePosition, FileRange, FoldKind, Query, RangeInfo, RunnableKind, Severity, Cancelable, }; use ra_syntax::{AstNode, TextUnit}; use rustc_hash::FxHashMap; @@ -40,9 +40,13 @@ pub fn handle_extend_selection( .into_iter() .map_conv_with(&line_index) .map(|range| FileRange { file_id, range }) - .map(|frange| world.analysis().extend_selection(frange)) - .map_conv_with(&line_index) - .collect(); + .map(|frange| { + world + .analysis() + .extend_selection(frange) + .map(|it| it.conv_with(&line_index)) + }) + .collect::>>()?; Ok(req::ExtendSelectionResult { selections }) } -- cgit v1.2.3