rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
13.68k stars 1.5k forks source link

Add `toggle_async_sugar` assist code action #17258

Closed maxwase closed 5 days ago

maxwase commented 2 weeks ago

Implement code action for sugaring and de-sugaring asynchronous functions.

This code action does not import Future trait when de-sugaring and does not touch function boby, I guess this can be implemented later if needed. This action also does not take into consideration other bounds because IMO it's usually "let me try to use sugared version here".

Feel free to request changes, that's my first code action implementation 😄

Closes #17010 Relates to #16195

rustbot commented 1 week ago

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git pull --rebase https://github.com/rust-lang/rust-analyzer.git master
$ git push --force-with-lease

The following commits are merge commits:

Veykril commented 5 days ago

Thanks! @bors r+

bors commented 5 days ago

:pushpin: Commit 61f8ef5d5747858c99db8338408036a6939083d7 has been approved by Veykril

It is now in the queue for this repository.

bors commented 5 days ago

:hourglass: Testing commit 61f8ef5d5747858c99db8338408036a6939083d7 with merge b32f181f477576bb203879f7539608f3327b6178...

bors commented 5 days ago

:sunny: Test successful - checks-actions Approved by: Veykril Pushing b32f181f477576bb203879f7539608f3327b6178 to master...