From 13eddd7c499388e956e47aae6a7210e43eb40d55 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 12 Aug 2019 13:12:45 +0300 Subject: Drop support for old extendSelection API Emacs now handles this via native LSP request https://github.com/emacs-lsp/lsp-mode/commit/dc86bbb227147aa8141e690ad5648fdbd2ebdb9f --- crates/ra_lsp_server/src/main_loop/handlers.rs | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'crates/ra_lsp_server/src/main_loop') 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::{ TextEdit, WorkspaceEdit, }; use ra_ide_api::{ - AssistId, Cancelable, FileId, FilePosition, FileRange, FoldKind, Query, Runnable, RunnableKind, + AssistId, FileId, FilePosition, FileRange, FoldKind, Query, Runnable, RunnableKind, }; use ra_prof::profile; use ra_syntax::{AstNode, SyntaxKind, TextRange, TextUnit}; @@ -45,27 +45,6 @@ pub fn handle_syntax_tree(world: WorldSnapshot, params: req::SyntaxTreeParams) - Ok(res) } -// FIXME: drop this API -pub fn handle_extend_selection( - world: WorldSnapshot, - params: req::ExtendSelectionParams, -) -> Result { - log::error!( - "extend selection is deprecated and will be removed soon, - use the new selection range API in LSP", - ); - let file_id = params.text_document.try_conv_with(&world)?; - let line_index = world.analysis().file_line_index(file_id)?; - let selections = params - .selections - .into_iter() - .map_conv_with(&line_index) - .map(|range| FileRange { file_id, range }) - .map(|frange| world.analysis().extend_selection(frange).map(|it| it.conv_with(&line_index))) - .collect::>>()?; - Ok(req::ExtendSelectionResult { selections }) -} - pub fn handle_selection_range( world: WorldSnapshot, params: req::SelectionRangeParams, -- cgit v1.2.3