Skip to content
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 7/7 #16577

Merged
merged 4 commits into from
Feb 16, 2024

Conversation

DropDemBits
Copy link
Contributor

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.

Used for allowing newly generated syntax constructs to be renamed without having to go through a separate rename step.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 16, 2024
All assists have been migrated to use the structured snippet versions of these methods.
@DropDemBits
Copy link
Contributor Author

@nemethf generate_trait_from_impl is the first assist that generates multiple SnippetTextEdits 😊

Discovered another snippet rendering issue which causes the placeholders to be placed a little weirdly, but they do still get placed and end up in the final SnippetTextEdits.

@DropDemBits
Copy link
Contributor Author

#16579 fixes the snippet rendering issues I encountered while testing this.

@Veykril
Copy link
Member

Veykril commented Feb 16, 2024

Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Feb 16, 2024

📌 Commit 4af075d has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Feb 16, 2024

⌛ Testing commit 4af075d with merge 8a0a09a...

@bors
Copy link
Collaborator

bors commented Feb 16, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 8a0a09a to master...

@bors bors merged commit 8a0a09a into rust-lang:master Feb 16, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants