diff options
author | Bernardo <[email protected]> | 2018-12-11 18:07:17 +0000 |
---|---|---|
committer | Bernardo <[email protected]> | 2018-12-11 18:07:17 +0000 |
commit | 0527e3b283af0153cf13fa64fe73862a5b7655c8 (patch) | |
tree | 07c4eacaad717ea802ab26972f45223281f2c9c1 /crates/ra_lsp_server | |
parent | 7344d28768c43d8955bf23c183d606be08f27c64 (diff) |
rename Edit to TextEdit and AtomEdit to AtomTextEdit
Diffstat (limited to 'crates/ra_lsp_server')
-rw-r--r-- | crates/ra_lsp_server/src/conv.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index 8bf8576be..7467f472c 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs | |||
@@ -1,10 +1,10 @@ | |||
1 | use languageserver_types::{ | 1 | use languageserver_types::{ |
2 | Location, Position, Range, SymbolKind, TextDocumentEdit, TextDocumentIdentifier, | 2 | self, Location, Position, Range, SymbolKind, TextDocumentEdit, TextDocumentIdentifier, |
3 | TextDocumentItem, TextDocumentPositionParams, TextEdit, Url, VersionedTextDocumentIdentifier, | 3 | TextDocumentItem, TextDocumentPositionParams, Url, VersionedTextDocumentIdentifier, |
4 | }; | 4 | }; |
5 | use ra_analysis::{FileId, FileSystemEdit, SourceChange, SourceFileNodeEdit, FilePosition}; | 5 | use ra_analysis::{FileId, FileSystemEdit, SourceChange, SourceFileNodeEdit, FilePosition}; |
6 | use ra_editor::{LineCol, LineIndex}; | 6 | use ra_editor::{LineCol, LineIndex}; |
7 | use ra_text_edit::{AtomEdit, Edit}; | 7 | use ra_text_edit::{AtomTextEdit, TextEdit}; |
8 | use ra_syntax::{SyntaxKind, TextRange, TextUnit}; | 8 | use ra_syntax::{SyntaxKind, TextRange, TextUnit}; |
9 | 9 | ||
10 | use crate::{req, server_world::ServerWorld, Result}; | 10 | use crate::{req, server_world::ServerWorld, Result}; |
@@ -92,11 +92,11 @@ impl ConvWith for Range { | |||
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||
95 | impl ConvWith for Edit { | 95 | impl ConvWith for TextEdit { |
96 | type Ctx = LineIndex; | 96 | type Ctx = LineIndex; |
97 | type Output = Vec<TextEdit>; | 97 | type Output = Vec<languageserver_types::TextEdit>; |
98 | 98 | ||
99 | fn conv_with(self, line_index: &LineIndex) -> Vec<TextEdit> { | 99 | fn conv_with(self, line_index: &LineIndex) -> Vec<languageserver_types::TextEdit> { |
100 | self.into_atoms() | 100 | self.into_atoms() |
101 | .into_iter() | 101 | .into_iter() |
102 | .map_conv_with(line_index) | 102 | .map_conv_with(line_index) |
@@ -104,12 +104,12 @@ impl ConvWith for Edit { | |||
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||
107 | impl ConvWith for AtomEdit { | 107 | impl ConvWith for AtomTextEdit { |
108 | type Ctx = LineIndex; | 108 | type Ctx = LineIndex; |
109 | type Output = TextEdit; | 109 | type Output = languageserver_types::TextEdit; |
110 | 110 | ||
111 | fn conv_with(self, line_index: &LineIndex) -> TextEdit { | 111 | fn conv_with(self, line_index: &LineIndex) -> languageserver_types::TextEdit { |
112 | TextEdit { | 112 | languageserver_types::TextEdit { |
113 | range: self.delete.conv_with(line_index), | 113 | range: self.delete.conv_with(line_index), |
114 | new_text: self.insert, | 114 | new_text: self.insert, |
115 | } | 115 | } |
@@ -229,7 +229,7 @@ impl TryConvWith for SourceChange { | |||
229 | fn translate_offset_with_edit( | 229 | fn translate_offset_with_edit( |
230 | pre_edit_index: &LineIndex, | 230 | pre_edit_index: &LineIndex, |
231 | offset: TextUnit, | 231 | offset: TextUnit, |
232 | edits: &[AtomEdit], | 232 | edits: &[AtomTextEdit], |
233 | ) -> LineCol { | 233 | ) -> LineCol { |
234 | let fallback = pre_edit_index.line_col(offset); | 234 | let fallback = pre_edit_index.line_col(offset); |
235 | let edit = match edits.first() { | 235 | let edit = match edits.first() { |