-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(ide-completion): extra sugar auto-completion async fn ...
in impl trait
for async fn in trait
that's defined in desugar form
#17737
Conversation
@@ -210,7 +210,7 @@ fn add_function_impl( | |||
ast::AssocItem::Fn(func) => func, | |||
_ => unreachable!(), | |||
}; | |||
|
|||
// TODO: need `function_decl` that unwraps future in the return type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Help wanted here🙋
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll have to manually traverse the AST here and stitch the edit together, that is something like transformed_fn.ret_type()
to fetch the return type, then you can match on that to check if its an ImplTrait
one etc
…impl trait` for `async fn in trait` that's defined in desugar form
56e8ba6
to
e2e3dbf
Compare
Finished up the work here, hope you don't mind :) @bors r+ |
feat(ide-completion): extra sugar auto-completion `async fn ...` in `impl trait` for `async fn in trait` that's defined in desugar form Solves #17719. --- Preview <img width="670" alt="image" src="https://github.com/user-attachments/assets/64ccef84-4062-4702-8760-89220585f422"> <img width="540" alt="image" src="https://github.com/user-attachments/assets/d22637f9-d531-43b2-a9f1-cd40a002903a"> <img width="631" alt="image" src="https://github.com/user-attachments/assets/21cd2142-bb8e-4493-9ac7-e6a9e7076904">
💔 Test failed - checks-actions |
e2e3dbf
to
eb64cc8
Compare
@bors r+ |
☀️ Test successful - checks-actions |
Not at all. Thank you very much. Finally no more manual async anymore :). |
Solves #17719.
Preview