aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r--crates/ra_ide/src/lib.rs9
1 files changed, 3 insertions, 6 deletions
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::{
89 symbol_index::Query, 89 symbol_index::Query,
90 RootDatabase, 90 RootDatabase,
91}; 91};
92pub use ra_text_edit::{Indel, TextEdit};
92 93
93pub type Cancelable<T> = Result<T, Canceled>; 94pub type Cancelable<T> = Result<T, Canceled>;
94 95
@@ -285,14 +286,10 @@ impl Analysis {
285 286
286 /// Returns an edit to remove all newlines in the range, cleaning up minor 287 /// Returns an edit to remove all newlines in the range, cleaning up minor
287 /// stuff like trailing commas. 288 /// stuff like trailing commas.
288 pub fn join_lines(&self, frange: FileRange) -> Cancelable<SourceChange> { 289 pub fn join_lines(&self, frange: FileRange) -> Cancelable<TextEdit> {
289 self.with_db(|db| { 290 self.with_db(|db| {
290 let parse = db.parse(frange.file_id); 291 let parse = db.parse(frange.file_id);
291 let file_edit = SourceFileEdit { 292 join_lines::join_lines(&parse.tree(), frange.range)
292 file_id: frange.file_id,
293 edit: join_lines::join_lines(&parse.tree(), frange.range),
294 };
295 SourceChange::source_file_edit("Join lines", file_edit)
296 }) 293 })
297 } 294 }
298 295