vscode-refactorix
vscode-refactorix copied to clipboard
Arrow function refactoring corrupts code
this.promise = new Promise<T>((resolve, reject) => {
this.resolve = resolve;
this.reject = reject;
let a = 42;
});
Abracadabra! (triggers extension.refactorix.ArrowFunction.ToggleSingleStatementBlockExpression)
this.promise = new Promise<T>((resolve, reject) => this.resolve = resolve); BaDumTssss
Notes:
- extension.refactorix.ArrowFunction.SingleStatementBlockToExpressionAll does the same thing to whole file
- Add an if statement into that block and you are safe.