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 or newFunction 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.
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
newLocalornewFunctionthat'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.