diff options
Diffstat (limited to 'crates/ra_lsp_server/src/conv.rs')
-rw-r--r-- | crates/ra_lsp_server/src/conv.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index 5d5a0c55e..28368787c 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs | |||
@@ -63,10 +63,7 @@ impl ConvWith for TextUnit { | |||
63 | 63 | ||
64 | fn conv_with(self, line_index: &LineIndex) -> Position { | 64 | fn conv_with(self, line_index: &LineIndex) -> Position { |
65 | let line_col = line_index.line_col(self); | 65 | let line_col = line_index.line_col(self); |
66 | Position::new( | 66 | Position::new(u64::from(line_col.line), u64::from(line_col.col_utf16)) |
67 | u64::from(line_col.line), | ||
68 | u64::from(u32::from(line_col.col_utf16)), | ||
69 | ) | ||
70 | } | 67 | } |
71 | } | 68 | } |
72 | 69 | ||
@@ -204,10 +201,8 @@ impl TryConvWith for SourceChange { | |||
204 | .map(|it| it.edits.as_slice()) | 201 | .map(|it| it.edits.as_slice()) |
205 | .unwrap_or(&[]); | 202 | .unwrap_or(&[]); |
206 | let line_col = translate_offset_with_edit(&*line_index, pos.offset, edits); | 203 | let line_col = translate_offset_with_edit(&*line_index, pos.offset, edits); |
207 | let position = Position::new( | 204 | let position = |
208 | u64::from(line_col.line), | 205 | Position::new(u64::from(line_col.line), u64::from(line_col.col_utf16)); |
209 | u64::from(u32::from(line_col.col_utf16)), | ||
210 | ); | ||
211 | Some(TextDocumentPositionParams { | 206 | Some(TextDocumentPositionParams { |
212 | text_document: TextDocumentIdentifier::new(pos.file_id.try_conv_with(world)?), | 207 | text_document: TextDocumentIdentifier::new(pos.file_id.try_conv_with(world)?), |
213 | position, | 208 | position, |