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

feat(ide-completion): extra sugar auto-completion async fn ... in impl trait for async fn in trait that's defined in desugar form #17737

Merged
merged 2 commits into from
Sep 1, 2024

Conversation

hyf0
Copy link
Contributor

@hyf0 hyf0 commented Jul 29, 2024

Solves #17719.


Preview

image image image

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 29, 2024
crates/hir/src/lib.rs Outdated Show resolved Hide resolved
@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Help wanted here🙋

Copy link
Member

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

@Veykril Veykril added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 2, 2024
…impl trait` for `async fn in trait` that's defined in desugar form
@Veykril Veykril marked this pull request as ready for review September 1, 2024 09:05
@Veykril
Copy link
Member

Veykril commented Sep 1, 2024

Finished up the work here, hope you don't mind :)

@bors r+

@bors
Copy link
Contributor

bors commented Sep 1, 2024

📌 Commit e2e3dbf has been approved by Veykril

It is now in the queue for this repository.

bors added a commit that referenced this pull request Sep 1, 2024
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">
@bors
Copy link
Contributor

bors commented Sep 1, 2024

⌛ Testing commit e2e3dbf with merge fc8a035...

@bors
Copy link
Contributor

bors commented Sep 1, 2024

💔 Test failed - checks-actions

@Veykril
Copy link
Member

Veykril commented Sep 1, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Sep 1, 2024

📌 Commit eb64cc8 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Sep 1, 2024

⌛ Testing commit eb64cc8 with merge 72fe274...

@bors
Copy link
Contributor

bors commented Sep 1, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 72fe274 to master...

@bors bors merged commit 72fe274 into rust-lang:master Sep 1, 2024
11 checks passed
@hyf0
Copy link
Contributor Author

hyf0 commented Sep 1, 2024

Not at all. Thank you very much. Finally no more manual async anymore :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants