diff options
author | Aleksey Kladov <[email protected]> | 2018-08-22 10:58:34 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-22 10:58:34 +0100 |
commit | e8dfb92641f64b772204d7670c7286cb9b8b398b (patch) | |
tree | bb305d3003d01756fc8c282f008108d05da7decf /crates/server/src/main_loop | |
parent | 641659d5a8dcca0b8a1c36ff6d1c517a91296116 (diff) |
Simplify
Diffstat (limited to 'crates/server/src/main_loop')
-rw-r--r-- | crates/server/src/main_loop/handlers.rs | 9 |
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 | }; |
8 | use libanalysis::{Query}; | 8 | use libanalysis::{Query}; |
9 | use libeditor::{self, CursorPosition}; | 9 | use libeditor; |
10 | use libsyntax2::TextUnit; | 10 | use libsyntax2::TextUnit; |
11 | use serde_json::{to_value, from_value}; | 11 | use 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 | ||