aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/assist_context.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/assist_context.rs')
-rw-r--r--crates/ra_assists/src/assist_context.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_assists/src/assist_context.rs b/crates/ra_assists/src/assist_context.rs
index 3640bb4d2..c33525363 100644
--- a/crates/ra_assists/src/assist_context.rs
+++ b/crates/ra_assists/src/assist_context.rs
@@ -176,7 +176,7 @@ pub(crate) struct AssistBuilder {
176 edit: TextEditBuilder, 176 edit: TextEditBuilder,
177 file_id: FileId, 177 file_id: FileId,
178 is_snippet: bool, 178 is_snippet: bool,
179 edits: Vec<SourceFileEdit>, 179 change: SourceChange,
180} 180}
181 181
182impl AssistBuilder { 182impl AssistBuilder {
@@ -185,7 +185,7 @@ impl AssistBuilder {
185 edit: TextEditBuilder::default(), 185 edit: TextEditBuilder::default(),
186 file_id, 186 file_id,
187 is_snippet: false, 187 is_snippet: false,
188 edits: Vec::new(), 188 change: SourceChange::default(),
189 } 189 }
190 } 190 }
191 191
@@ -197,8 +197,8 @@ impl AssistBuilder {
197 let edit = mem::take(&mut self.edit).finish(); 197 let edit = mem::take(&mut self.edit).finish();
198 if !edit.is_empty() { 198 if !edit.is_empty() {
199 let new_edit = SourceFileEdit { file_id: self.file_id, edit }; 199 let new_edit = SourceFileEdit { file_id: self.file_id, edit };
200 assert!(!self.edits.iter().any(|it| it.file_id == new_edit.file_id)); 200 assert!(!self.change.source_file_edits.iter().any(|it| it.file_id == new_edit.file_id));
201 self.edits.push(new_edit); 201 self.change.source_file_edits.push(new_edit);
202 } 202 }
203 } 203 }
204 204
@@ -265,10 +265,10 @@ impl AssistBuilder {
265 265
266 fn finish(mut self) -> SourceChange { 266 fn finish(mut self) -> SourceChange {
267 self.commit(); 267 self.commit();
268 let mut res: SourceChange = mem::take(&mut self.edits).into(); 268 let mut change = mem::take(&mut self.change);
269 if self.is_snippet { 269 if self.is_snippet {
270 res.is_snippet = true; 270 change.is_snippet = true;
271 } 271 }
272 res 272 change
273 } 273 }
274} 274}