Skip to content

Support textEdits on type hints #11934

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

Closed
lnicola opened this issue Apr 8, 2022 · 2 comments · Fixed by #18920
Closed

Support textEdits on type hints #11934

lnicola opened this issue Apr 8, 2022 · 2 comments · Fixed by #18920
Labels
A-inlay-hints inlay/inline hints C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now

Comments

@lnicola
Copy link
Member

lnicola commented Apr 8, 2022

Added in Code 1.60:

The InlayHint type can now have an optional, lazy textEdits property. Inlay hints that have edits set to them will apply them on double-click. The textEdits should be used to make the edits that are needed to make the inlay hint obsolete. For example, double clicking a hint representing an inferred type should insert that type annotation.

@lnicola lnicola added S-actionable Someone could pick this issue up and work on it right now C-feature Category: feature request A-inlay-hints inlay/inline hints labels Apr 8, 2022
@lnicola lnicola changed the title Support textEdits on inlay hints Support textEdits on type hints Apr 8, 2022
@lowr
Copy link
Contributor

lowr commented Apr 16, 2023

Oh I didn't notice this issue until now. Text edits for top-level bind_pat and closure_return hints have been implemented in #14533 (cc #13812). It might make sense to provide edits for fn_lifetime_fn and implicit_static but not sure how useful they would be.

@Veykril
Copy link
Member

Veykril commented Apr 16, 2023

I think it would make sense to generally have them for all hints that are actual valid syntax (even if they aren't too useful in some cases)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inlay-hints inlay/inline hints C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants