Proposal
Add a refactoring to inline a local variable. Example:
function generatePipeName(): string {
const hexString = makeRandomHexString(40);
return getPipeName(hexString);
}
The Inline local refactoring on hexString would result in:
function generatePipeName(): string {
return getPipeName(makeRandomHexString(40));
}
I've been working on this issue for a while now, but I'm not too familiar with the compiler API. Is there a way to dynamically generate a new node based on the SyntaxKind of another? I'm concerned that if I just make a copy, the id will stay the same and that would lead to problems down the road.
@weswigham What is the label in discussion for? Is it being discussed whether to implement the issue at all, or is there a different meaning? I would like to implement it in the near future (1-2 weeks).
Ah, just means we're considering it for inclusion. Everything that's labeled as a "Suggestion" is supposed to have one of a set of sublabels indicative of the issue's state. I felt that was probably most correct here (it's not "committed" because we've not allocated anyone to work on it).
Anyone suggest a VSCode extension that does this in lieu of waiting for official support?
Anyone suggest a VSCode extension that does this in lieu of waiting for official support?
Most helpful comment
https://github.com/nicoespeon/abracadabra#inline-variable