diff options
Diffstat (limited to 'crates/ra_assists/src/assist_ctx.rs')
-rw-r--r-- | crates/ra_assists/src/assist_ctx.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/crates/ra_assists/src/assist_ctx.rs b/crates/ra_assists/src/assist_ctx.rs index cbe12e908..5f564be0b 100644 --- a/crates/ra_assists/src/assist_ctx.rs +++ b/crates/ra_assists/src/assist_ctx.rs | |||
@@ -178,9 +178,7 @@ impl AssistBuilder { | |||
178 | } | 178 | } |
179 | 179 | ||
180 | pub(crate) fn replace_ast<N: AstNode>(&mut self, old: N, new: N) { | 180 | pub(crate) fn replace_ast<N: AstNode>(&mut self, old: N, new: N) { |
181 | for (from, to) in algo::diff(old.syntax(), new.syntax()) { | 181 | algo::diff(old.syntax(), new.syntax()).into_text_edit(&mut self.edit) |
182 | self.edit.replace(from.text_range(), to.to_string()) | ||
183 | } | ||
184 | } | 182 | } |
185 | 183 | ||
186 | fn build(self) -> AssistAction { | 184 | fn build(self) -> AssistAction { |