Skip to content

Commit a4e6963

Browse files
bors[bot]matklad
andauthored
Merge #4547
4547: Remove unused cursor positions r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 42dd0ce + 4fdb1ea commit a4e6963

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

crates/ra_assists/src/assist_context.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,7 @@ impl AssistBuilder {
248248

249249
fn finish(self, change_label: String) -> SourceChange {
250250
let edit = self.edit.finish();
251-
let mut res = SingleFileChange { label: change_label, edit, cursor_position: None }
252-
.into_source_change(self.file);
251+
let mut res = SingleFileChange { label: change_label, edit }.into_source_change(self.file);
253252
if self.is_snippet {
254253
res.is_snippet = true;
255254
}

crates/ra_ide/src/typing.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ fn on_eq_typed(file: &SourceFile, offset: TextSize) -> Option<SingleFileChange>
8282
Some(SingleFileChange {
8383
label: "add semicolon".to_string(),
8484
edit: TextEdit::insert(offset, ";".to_string()),
85-
cursor_position: None,
8685
})
8786
}
8887

@@ -111,7 +110,6 @@ fn on_dot_typed(file: &SourceFile, offset: TextSize) -> Option<SingleFileChange>
111110
Some(SingleFileChange {
112111
label: "reindent dot".to_string(),
113112
edit: TextEdit::replace(TextRange::new(offset - current_indent_len, offset), target_indent),
114-
cursor_position: None,
115113
})
116114
}
117115

@@ -130,7 +128,6 @@ fn on_arrow_typed(file: &SourceFile, offset: TextSize) -> Option<SingleFileChang
130128
Some(SingleFileChange {
131129
label: "add space after return type".to_string(),
132130
edit: TextEdit::insert(after_arrow, " ".to_string()),
133-
cursor_position: None,
134131
})
135132
}
136133

crates/ra_ide_db/src/source_change.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! It can be viewed as a dual for `AnalysisChange`.
55
66
use ra_db::{FileId, FilePosition, RelativePathBuf, SourceRootId};
7-
use ra_text_edit::{TextEdit, TextSize};
7+
use ra_text_edit::TextEdit;
88

99
#[derive(Debug, Clone)]
1010
pub struct SourceChange {
@@ -109,7 +109,6 @@ pub enum FileSystemEdit {
109109
pub struct SingleFileChange {
110110
pub label: String,
111111
pub edit: TextEdit,
112-
pub cursor_position: Option<TextSize>,
113112
}
114113

115114
impl SingleFileChange {
@@ -118,7 +117,7 @@ impl SingleFileChange {
118117
label: self.label,
119118
source_file_edits: vec![SourceFileEdit { file_id, edit: self.edit }],
120119
file_system_edits: Vec::new(),
121-
cursor_position: self.cursor_position.map(|offset| FilePosition { file_id, offset }),
120+
cursor_position: None,
122121
is_snippet: false,
123122
}
124123
}

0 commit comments

Comments
 (0)