Unnamed repository; edit this file 'description' to name the repository.
update edits with new annotation semantics
| -rw-r--r-- | crates/ide-assists/src/handlers/generate_blanket_trait_impl.rs | 2 | ||||
| -rw-r--r-- | crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/crates/ide-assists/src/handlers/generate_blanket_trait_impl.rs b/crates/ide-assists/src/handlers/generate_blanket_trait_impl.rs index 1e3f2ac677..acd98aed00 100644 --- a/crates/ide-assists/src/handlers/generate_blanket_trait_impl.rs +++ b/crates/ide-assists/src/handlers/generate_blanket_trait_impl.rs @@ -141,7 +141,7 @@ pub(crate) fn generate_blanket_trait_impl( if let Some(cap) = ctx.config.snippet_cap && let Some(self_ty) = impl_.self_ty() { - builder.add_tabstop_before(cap, self_ty); + editor.add_annotation(self_ty.syntax(), builder.make_tabstop_before(cap)); } builder.add_file_edits(ctx.vfs_file_id(), editor); }, diff --git a/crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs b/crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs index 4e85b30b58..707b3321c3 100644 --- a/crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs +++ b/crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs @@ -187,15 +187,18 @@ fn add_assist( && m.syntax().text() == "todo!()" { // Make the `todo!()` a placeholder - builder.add_placeholder_snippet(cap, m); + editor.add_annotation(m.syntax(), builder.make_placeholder_snippet(cap)); } else { // If we haven't already added a snippet, add a tabstop before the generated function - builder.add_tabstop_before(cap, first_assoc_item); + editor.add_annotation( + first_assoc_item.syntax(), + builder.make_tabstop_before(cap), + ); } } else if let Some(l_curly) = impl_def.assoc_item_list().and_then(|it| it.l_curly_token()) { - builder.add_tabstop_after_token(cap, l_curly); + editor.add_annotation(l_curly, builder.make_tabstop_after(cap)); } } |