From 4fdb1eac08bc29029fe888967dcc11d38d25c205 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 21 May 2020 00:46:08 +0200 Subject: Remove unused cursor positions --- crates/ra_assists/src/assist_context.rs | 3 +-- crates/ra_ide/src/typing.rs | 3 --- crates/ra_ide_db/src/source_change.rs | 5 ++--- 3 files changed, 3 insertions(+), 8 deletions(-) (limited to 'crates') diff --git a/crates/ra_assists/src/assist_context.rs b/crates/ra_assists/src/assist_context.rs index 9f6ca449b..f3af70a3e 100644 --- a/crates/ra_assists/src/assist_context.rs +++ b/crates/ra_assists/src/assist_context.rs @@ -248,8 +248,7 @@ impl AssistBuilder { fn finish(self, change_label: String) -> SourceChange { let edit = self.edit.finish(); - let mut res = SingleFileChange { label: change_label, edit, cursor_position: None } - .into_source_change(self.file); + let mut res = SingleFileChange { label: change_label, edit }.into_source_change(self.file); if self.is_snippet { res.is_snippet = true; } diff --git a/crates/ra_ide/src/typing.rs b/crates/ra_ide/src/typing.rs index 867a0f0bd..cd48cad93 100644 --- a/crates/ra_ide/src/typing.rs +++ b/crates/ra_ide/src/typing.rs @@ -82,7 +82,6 @@ fn on_eq_typed(file: &SourceFile, offset: TextSize) -> Option Some(SingleFileChange { label: "add semicolon".to_string(), edit: TextEdit::insert(offset, ";".to_string()), - cursor_position: None, }) } @@ -111,7 +110,6 @@ fn on_dot_typed(file: &SourceFile, offset: TextSize) -> Option Some(SingleFileChange { label: "reindent dot".to_string(), edit: TextEdit::replace(TextRange::new(offset - current_indent_len, offset), target_indent), - cursor_position: None, }) } @@ -130,7 +128,6 @@ fn on_arrow_typed(file: &SourceFile, offset: TextSize) -> Option, } impl SingleFileChange { @@ -118,7 +117,7 @@ impl SingleFileChange { label: self.label, source_file_edits: vec![SourceFileEdit { file_id, edit: self.edit }], file_system_edits: Vec::new(), - cursor_position: self.cursor_position.map(|offset| FilePosition { file_id, offset }), + cursor_position: None, is_snippet: false, } } -- cgit v1.2.3