Skip to content

completions: Add rudimentary support for closure completions#21683

Open
osiewicz wants to merge 6 commits intorust-lang:masterfrom
osiewicz:closure-completions
Open

completions: Add rudimentary support for closure completions#21683
osiewicz wants to merge 6 commits intorust-lang:masterfrom
osiewicz:closure-completions

Conversation

@osiewicz
Copy link
Contributor

@osiewicz osiewicz commented Feb 20, 2026

Related to #8676
Related to #9444

CleanShot.2026-02-20.at.11.35.29.mp4

Closure parameter names are a bit wacky, but they've been that way even before this PR; we should probably filter out suggestions for patterns that cannot actually be destructured.

@osiewicz osiewicz force-pushed the closure-completions branch 2 times, most recently from 482555b to 815a349 Compare February 20, 2026 10:56
@osiewicz osiewicz marked this pull request as ready for review February 20, 2026 11:40
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 20, 2026
@rustbot

This comment has been minimized.

dinocosta and others added 4 commits February 20, 2026 12:42
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
@osiewicz osiewicz force-pushed the closure-completions branch from 4d5c11c to 1a36b43 Compare February 20, 2026 11:43
osiewicz and others added 2 commits February 20, 2026 13:01
parameter

Co-authored-by: dino <dinojoaocosta@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
r#"
fn foo<T>(f: impl Fn(T) -> T) {}
fn main() {
foo(|${1:_}: ${2:T}| $0);
Copy link
Member

Choose a reason for hiding this comment

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

Don't you consider using NameGenerator to generate parameters?
Just like a |x0, x1, items|

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess we could do that, yes.

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.

4 participants