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 more assists to use the structured snippet API #15231

Merged
merged 9 commits into from Jul 10, 2023

Conversation

DropDemBits
Copy link
Contributor

Continuing from #14979

Migrates the following assists:

  • generate_derive
  • wrap_return_type_in_result
  • generate_delegate_methods

As a bonus, generate_delegate_methods now generates the function and impl block at the correct indentation 🎉.

Can actually split out adding the functions from  getting the impl to
update or create thanks to being able to refer to the impl ast node.

FIXME Context:
Unfortunately we can't adjust the indentation of the newly added function
inside of `ast::AssocItemList::add_item` since for some reason the `todo!()`
placeholder generated by `add_missing_impl_members` and
`replace_derive_with_manual_impl` gets indented weirdly.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 8, 2023
Copy link
Contributor

@lowr lowr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One super pedantic nit, otherwise looks awesome!

crates/ide-assists/src/handlers/generate_derive.rs Outdated Show resolved Hide resolved
@lowr
Copy link
Contributor

lowr commented Jul 10, 2023

Thanks!

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 10, 2023

📌 Commit 5fddf3e has been approved by lowr

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jul 10, 2023

⌛ Testing commit 5fddf3e with merge 2f6d545...

@bors
Copy link
Collaborator

bors commented Jul 10, 2023

☀️ Test successful - checks-actions
Approved by: lowr
Pushing 2f6d545 to master...

1 similar comment
@bors
Copy link
Collaborator

bors commented Jul 10, 2023

☀️ Test successful - checks-actions
Approved by: lowr
Pushing 2f6d545 to master...

@bors bors merged commit 2f6d545 into rust-lang:master Jul 10, 2023
10 checks passed
@bors
Copy link
Collaborator

bors commented Jul 10, 2023

👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request.

bors added a commit that referenced this pull request Jul 12, 2023
internal: Migrate assists to the structured snippet API, part 3

Continuing from #15231

Migrates the following assists:
- `add_missing_match_arms`
- `fix_visibility`
- `promote_local_to_const`

The `add_missing_match_arms` changes are best reviewed commit-by-commit since they're relatively big changes compared to the rest of the commits.
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