Open maricn opened 4 years ago
Hi @maricn,
That's a good idea for a refactoring!
I need however to do some additional research to see what would be the best place to implement this feature.
This refactoring requires to have the information about variables in the current scope and also locate all the usages in order to inline them. Right now what we operate with is just a bare syntax tree (that's enough for most code fixes).
On the other hand, the TypeScript compiler team has a way to provide JavaScript (not only TypeScript) refactorings using the TypeScript services. It might be worth investigating for this feature because they have way more information about the code since they have the compiler at their disposal.
I will do the research and find a better way to go forward.
Thanks for reporting!
I find inline refactoring very useful (coming from IntelliJ world: https://www.jetbrains.com/help/idea/inline.html).
before:
after:
could be done with objects, statements and functions.