rust-lang / rust-analyzer

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

Feature request: Offer "generate function" on unknown identifiers passed to higher-order functions #18221

Open jplatte opened 1 month ago

jplatte commented 1 month ago

Given an input like

let foo = vec![1, 2, 3].iter().map(make_foo);

where make_foo doesn't resolve, it would be nice if RA offered to generate an fn make_foo(arg0: i32) -> _.

ChayimFriedman2 commented 1 month ago

This will have the same difficulty as #3148.