-
Notifications
You must be signed in to change notification settings - Fork 1.7k
internal: Migrate assists to the structured snippet API, part 6/7 #16467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal: Migrate assists to the structured snippet API, part 6/7 #16467
Conversation
Fixes #13558 too, since the structured snippet API always escapes existing backslashes and dollar signs in code. |
26cdb10
to
d6dd9eb
Compare
Thanks! |
…ykril internal: Migrate assists to the structured snippet API, part 6/7 Continuing from #16082 Migrates the following assists: - `extract_function` - `generate_getter_or_setter` - `generate_impl` - `generate_new` - `replace_derive_with_manual_impl` Would've been the final PR in the structured snippet migration series, but I didn't notice that `generate_trait_from_impl` started to use `{insert,replace}_snippet` when I first started the migration 😅. This appears to be a pretty self-contained change, so I'll leave that for a separate future PR. This also removes the last usages of `render_snippet`, which was a follow up goal of #11638. 🎉
💔 Test failed - checks-actions |
Some clippy lints need fixing (we enabled clippy since) |
✌️ @DropDemBits, you can now approve this pull request! If @Veykril told you to " |
☔ The latest upstream changes (presumably #16477) made this pull request unmergeable. Please resolve the merge conflicts. |
`make::impl_` no longer merges generic params and args in order to be in line with `make::impl_`, which doesn't do it either.
Shortcut version of `make::expr_path(make::path_unqualified(make::path_segment_self()))`
Needed to recreate the behavior of `generate_new` addding the `new` method at the start of the impl
All usages of `render_snippet` and `Cursor` have been removed as part of the migration
d6dd9eb
to
11b075b
Compare
11b075b
to
05b8ccc
Compare
@bors r+ |
☀️ Test successful - checks-actions |
…ykril internal: Migrate assists to the structured snippet API, part 7/7 Continuing from #16467 Migrates the following assists: - `generate_trait_from_impl` This adds `add_placeholder_snippet_group`, which adds a group of placeholder snippets which are linked together and allows for renaming generated items without going through a separate rename step. This also removes the last usages of `SourceChangeBuilder::{insert,replace}_snippet`, as all assists have finally been migrated to the structured snippet versions of those methods.
Continuing from #16082
Migrates the following assists:
extract_function
generate_getter_or_setter
generate_impl
generate_new
replace_derive_with_manual_impl
Would've been the final PR in the structured snippet migration series, but I didn't notice that
generate_trait_from_impl
started to use{insert,replace}_snippet
when I first started the migration 😅. This appears to be a pretty self-contained change, so I'll leave that for a separate future PR.This also removes the last usages of
render_snippet
, which was a follow up goal of #11638. 🎉