Copilot-based infer types from usage for Typescript #190690
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a prototype of a copilot-based codefix that's the equivalent of Typescript's Infer From Usage codefix. Unlike that codefix, it uses only the body of the function (and any surrounding code) to infer types. However, it creates new interfaces with reasonable names and uses them where appropriate, which the old codefix cannot.
I have a lot of open questions about how this codefix should work, so I want to get it into Insiders, perhaps with an attached survey. I found that the copilot chat extension already logs telemetry about which button users press on the editorChat window, which might be good enough.
Some open questions:
typescript.experimental.aiQuickFix
setting?More work needed: