diff options
author | Aleksey Kladov <[email protected]> | 2019-01-20 18:05:01 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-20 18:05:01 +0000 |
commit | 73836cdbbc928f3512156f0bc0166e5a39ad9864 (patch) | |
tree | 0cdaf64f538467c3f5a974cac51413f495250f06 /crates/ra_lsp_server/src/main_loop | |
parent | 171f6e6d00d1fc99395b7b92c8a40b47d6bd6962 (diff) |
extend selection expands macros and can totally panic
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 12 |
1 files changed, 8 insertions, 4 deletions
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::{ | |||
8 | WorkspaceEdit | 8 | WorkspaceEdit |
9 | }; | 9 | }; |
10 | use ra_ide_api::{ | 10 | use ra_ide_api::{ |
11 | FileId, FilePosition, FileRange, FoldKind, Query, RangeInfo, RunnableKind, Severity, | 11 | FileId, FilePosition, FileRange, FoldKind, Query, RangeInfo, RunnableKind, Severity, Cancelable, |
12 | }; | 12 | }; |
13 | use ra_syntax::{AstNode, TextUnit}; | 13 | use ra_syntax::{AstNode, TextUnit}; |
14 | use rustc_hash::FxHashMap; | 14 | use rustc_hash::FxHashMap; |
@@ -40,9 +40,13 @@ pub fn handle_extend_selection( | |||
40 | .into_iter() | 40 | .into_iter() |
41 | .map_conv_with(&line_index) | 41 | .map_conv_with(&line_index) |
42 | .map(|range| FileRange { file_id, range }) | 42 | .map(|range| FileRange { file_id, range }) |
43 | .map(|frange| world.analysis().extend_selection(frange)) | 43 | .map(|frange| { |
44 | .map_conv_with(&line_index) | 44 | world |
45 | .collect(); | 45 | .analysis() |
46 | .extend_selection(frange) | ||
47 | .map(|it| it.conv_with(&line_index)) | ||
48 | }) | ||
49 | .collect::<Cancelable<Vec<_>>>()?; | ||
46 | Ok(req::ExtendSelectionResult { selections }) | 50 | Ok(req::ExtendSelectionResult { selections }) |
47 | } | 51 | } |
48 | 52 | ||