Open
Description
Inlay hints can have text edits which can be provided to "apply" the inlay hint when double clicked on. I noticed this recently in the python language server's inlay hints, that I could do:
We could provide text edits which would auto-import any type that is referred to, and insert the type annotation, where syntactically valid.
For example:
fn foo() {
let eligible = "hello".starts_with(|c| c.is_uppercase());
// ^ `: bool ` ^ `: char`
match Some(eligible) {
Some(n) => { }
// ^ not eligible, because inserting `: bool` here would not be valid syntax.
None => { }
}
}