From 0527e3b283af0153cf13fa64fe73862a5b7655c8 Mon Sep 17 00:00:00 2001 From: Bernardo Date: Tue, 11 Dec 2018 19:07:17 +0100 Subject: rename Edit to TextEdit and AtomEdit to AtomTextEdit --- crates/ra_lsp_server/src/conv.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'crates/ra_lsp_server/src') 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 @@ use languageserver_types::{ - Location, Position, Range, SymbolKind, TextDocumentEdit, TextDocumentIdentifier, - TextDocumentItem, TextDocumentPositionParams, TextEdit, Url, VersionedTextDocumentIdentifier, + self, Location, Position, Range, SymbolKind, TextDocumentEdit, TextDocumentIdentifier, + TextDocumentItem, TextDocumentPositionParams, Url, VersionedTextDocumentIdentifier, }; use ra_analysis::{FileId, FileSystemEdit, SourceChange, SourceFileNodeEdit, FilePosition}; use ra_editor::{LineCol, LineIndex}; -use ra_text_edit::{AtomEdit, Edit}; +use ra_text_edit::{AtomTextEdit, TextEdit}; use ra_syntax::{SyntaxKind, TextRange, TextUnit}; use crate::{req, server_world::ServerWorld, Result}; @@ -92,11 +92,11 @@ impl ConvWith for Range { } } -impl ConvWith for Edit { +impl ConvWith for TextEdit { type Ctx = LineIndex; - type Output = Vec; + type Output = Vec; - fn conv_with(self, line_index: &LineIndex) -> Vec { + fn conv_with(self, line_index: &LineIndex) -> Vec { self.into_atoms() .into_iter() .map_conv_with(line_index) @@ -104,12 +104,12 @@ impl ConvWith for Edit { } } -impl ConvWith for AtomEdit { +impl ConvWith for AtomTextEdit { type Ctx = LineIndex; - type Output = TextEdit; + type Output = languageserver_types::TextEdit; - fn conv_with(self, line_index: &LineIndex) -> TextEdit { - TextEdit { + fn conv_with(self, line_index: &LineIndex) -> languageserver_types::TextEdit { + languageserver_types::TextEdit { range: self.delete.conv_with(line_index), new_text: self.insert, } @@ -229,7 +229,7 @@ impl TryConvWith for SourceChange { fn translate_offset_with_edit( pre_edit_index: &LineIndex, offset: TextUnit, - edits: &[AtomEdit], + edits: &[AtomTextEdit], ) -> LineCol { let fallback = pre_edit_index.line_col(offset); let edit = match edits.first() { -- cgit v1.2.3