aboutsummaryrefslogtreecommitdiff
path: root/crates/server/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-22 10:58:34 +0100
committerAleksey Kladov <[email protected]>2018-08-22 10:58:34 +0100
commite8dfb92641f64b772204d7670c7286cb9b8b398b (patch)
treebb305d3003d01756fc8c282f008108d05da7decf /crates/server/src
parent641659d5a8dcca0b8a1c36ff6d1c517a91296116 (diff)
Simplify
Diffstat (limited to 'crates/server/src')
-rw-r--r--crates/server/src/main_loop/handlers.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/server/src/main_loop/handlers.rs b/crates/server/src/main_loop/handlers.rs
index 16cc92464..9ff821a8b 100644
--- a/crates/server/src/main_loop/handlers.rs
+++ b/crates/server/src/main_loop/handlers.rs
@@ -6,7 +6,7 @@ use languageserver_types::{
6 SymbolInformation, Position, Location, 6 SymbolInformation, Position, Location,
7}; 7};
8use libanalysis::{Query}; 8use libanalysis::{Query};
9use libeditor::{self, CursorPosition}; 9use libeditor;
10use libsyntax2::TextUnit; 10use libsyntax2::TextUnit;
11use serde_json::{to_value, from_value}; 11use serde_json::{to_value, from_value};
12 12
@@ -230,11 +230,8 @@ pub fn handle_execute_command(
230 document_changes: None, 230 document_changes: None,
231 }; 231 };
232 let edit = req::ApplyWorkspaceEditParams { edit }; 232 let edit = req::ApplyWorkspaceEditParams { edit };
233 let cursor_pos = match action_result.cursor_position { 233 let cursor_pos = action_result.cursor_position
234 CursorPosition::Same => None, 234 .map(|off| off.conv_with(&line_index));
235 CursorPosition::Offset(offset) => Some(offset.conv_with(&line_index)),
236 };
237
238 Ok((edit, cursor_pos)) 235 Ok((edit, cursor_pos))
239} 236}
240 237