-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Experiment with threading AI into extraction refactorings #182779
Comments
This should be controlled by a setting for sure. Here are the outcomes I can see with this feature:
|
I think TypeScript should try to infer name using common naming conventions at least (such as From my experience it covers ~20% of code and can be useful if AI suggestions are slow, unavailable or a user doesn't want to use the AI generated names at all. |
Why not instead expose this through an API? So it's not tied to a single technology. It would allow valuable customization to make sure the name conforms to project guidelines, or takes into account various patterns from a given framework. In some cases even allow the name to be inferred statically by the content without AI. |
|
@DanielRosenwasser - is this the newly added behavior? |
Marking this as an exploration. We'll create test items for the individual features that came out of it |
Today, TSServer provides several actions for "extract to function" and "extract to local" for both TypeScript and JavaScript. Currently, TSServer just creates a pre-generated name like
newLocal
ornewFunction
that's sufficiently unique. While this is fine, it would be interesting if we could use a language model to come up with a useful name and calculate a better name while TypeScript itself calculates the refactoring.In cases where a language model can "confidently" calculate a new name, that name can replace the contents of the automatically-invoked rename for the refactor.
The text was updated successfully, but these errors were encountered: