-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolFix AvailableA PR has been opened for this issueA PR has been opened for this issueVS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestoneCritical issues that VS Code needs fixed in the current TypeScript milestone
Milestone
Description
TypeScript Version: 3.9.0-dev.20200416
Search Terms:
- refactor / refactoring
- format
Code
For the code:
function foo() {
if (true) {
console.log(1);
} else {
console.log(1);
}
}
- Select the body of the function and run
extract to function
Bug:
In the new function, a new line is added before the else
:
function foo() {
newFunction();
}
function newFunction() {
if (true) {
console.log(1);
}
else {
console.log(1);
}
}
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolFix AvailableA PR has been opened for this issueA PR has been opened for this issueVS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestoneCritical issues that VS Code needs fixed in the current TypeScript milestone