diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-12 11:49:59 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-12 11:49:59 +0100 |
commit | d5e8fa606de0f42544f8379d498be5acd78259de (patch) | |
tree | 07e031193619aaee5b691e22f9e82361fdbbd1b7 /crates/ra_lsp_server/src/main_loop | |
parent | cce31580e1ec1770b7a5bf4e6fd3441df2c74533 (diff) | |
parent | 13eddd7c499388e956e47aae6a7210e43eb40d55 (diff) |
Merge #1682
1682: Drop support for old extendSelection API r=matklad a=matklad
Emacs now handles this via native LSP request
https://github.com/emacs-lsp/lsp-mode/commit/dc86bbb227147aa8141e690ad5648fdbd2ebdb9f
r? @flodiebold
(Have not actually tried elisp code)
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 4ac051c96..a3d3f167c 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -9,7 +9,7 @@ use lsp_types::{ | |||
9 | TextEdit, WorkspaceEdit, | 9 | TextEdit, WorkspaceEdit, |
10 | }; | 10 | }; |
11 | use ra_ide_api::{ | 11 | use ra_ide_api::{ |
12 | AssistId, Cancelable, FileId, FilePosition, FileRange, FoldKind, Query, Runnable, RunnableKind, | 12 | AssistId, FileId, FilePosition, FileRange, FoldKind, Query, Runnable, RunnableKind, |
13 | }; | 13 | }; |
14 | use ra_prof::profile; | 14 | use ra_prof::profile; |
15 | use ra_syntax::{AstNode, SyntaxKind, TextRange, TextUnit}; | 15 | use ra_syntax::{AstNode, SyntaxKind, TextRange, TextUnit}; |
@@ -45,27 +45,6 @@ pub fn handle_syntax_tree(world: WorldSnapshot, params: req::SyntaxTreeParams) - | |||
45 | Ok(res) | 45 | Ok(res) |
46 | } | 46 | } |
47 | 47 | ||
48 | // FIXME: drop this API | ||
49 | pub fn handle_extend_selection( | ||
50 | world: WorldSnapshot, | ||
51 | params: req::ExtendSelectionParams, | ||
52 | ) -> Result<req::ExtendSelectionResult> { | ||
53 | log::error!( | ||
54 | "extend selection is deprecated and will be removed soon, | ||
55 | use the new selection range API in LSP", | ||
56 | ); | ||
57 | let file_id = params.text_document.try_conv_with(&world)?; | ||
58 | let line_index = world.analysis().file_line_index(file_id)?; | ||
59 | let selections = params | ||
60 | .selections | ||
61 | .into_iter() | ||
62 | .map_conv_with(&line_index) | ||
63 | .map(|range| FileRange { file_id, range }) | ||
64 | .map(|frange| world.analysis().extend_selection(frange).map(|it| it.conv_with(&line_index))) | ||
65 | .collect::<Cancelable<Vec<_>>>()?; | ||
66 | Ok(req::ExtendSelectionResult { selections }) | ||
67 | } | ||
68 | |||
69 | pub fn handle_selection_range( | 48 | pub fn handle_selection_range( |
70 | world: WorldSnapshot, | 49 | world: WorldSnapshot, |
71 | params: req::SelectionRangeParams, | 50 | params: req::SelectionRangeParams, |