From 5b5ebec440841ee98a0aa70b71a135d94f5ca077 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 21 May 2020 19:50:23 +0200 Subject: Formalize JoinLines protocol extension --- crates/ra_ide/src/lib.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index d0aeb3ba7..97ff67ee8 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs @@ -89,6 +89,7 @@ pub use ra_ide_db::{ symbol_index::Query, RootDatabase, }; +pub use ra_text_edit::{Indel, TextEdit}; pub type Cancelable = Result; @@ -285,14 +286,10 @@ impl Analysis { /// Returns an edit to remove all newlines in the range, cleaning up minor /// stuff like trailing commas. - pub fn join_lines(&self, frange: FileRange) -> Cancelable { + pub fn join_lines(&self, frange: FileRange) -> Cancelable { self.with_db(|db| { let parse = db.parse(frange.file_id); - let file_edit = SourceFileEdit { - file_id: frange.file_id, - edit: join_lines::join_lines(&parse.tree(), frange.range), - }; - SourceChange::source_file_edit("Join lines", file_edit) + join_lines::join_lines(&parse.tree(), frange.range) }) } -- cgit v1.2.3