Skip to content

Commit e9ac87c

Browse files
committed
Don't insert a blank line after extracted locals
Still insert a blank line after extracted properties.
1 parent a3ab1ff commit e9ac87c

40 files changed

Lines changed: 1 addition & 46 deletions

File tree

src/services/refactors/extractSymbol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ namespace ts.refactor.extractSymbol {
10801080
changeTracker.insertNodeAtTopOfFile(context.file, newVariableStatement);
10811081
}
10821082
else {
1083-
changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ true);
1083+
changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false);
10841084
}
10851085

10861086
// Consume

tests/baselines/reference/extractConstant/extractConstant_ArrowFunction_Block.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const f = () => {
77

88
const f = () => {
99
const newLocal = 2 + 1;
10-
1110
return /*RENAME*/newLocal;
1211
};
1312
// ==SCOPE::Extract to constant in global scope==

tests/baselines/reference/extractConstant/extractConstant_ArrowFunction_Block.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const f = () => {
77

88
const f = () => {
99
const newLocal = 2 + 1;
10-
1110
return /*RENAME*/newLocal;
1211
};
1312
// ==SCOPE::Extract to constant in global scope==

tests/baselines/reference/extractConstant/extractConstant_BlockScopeMismatch.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ for (let i = 0; i < 10; i++) {
1111
for (let i = 0; i < 10; i++) {
1212
for (let j = 0; j < 10; j++) {
1313
const newLocal = i + 1;
14-
1514
const x = /*RENAME*/newLocal;
1615
}
1716
}

tests/baselines/reference/extractConstant/extractConstant_BlockScopeMismatch.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ for (let i = 0; i < 10; i++) {
1111
for (let i = 0; i < 10; i++) {
1212
for (let j = 0; j < 10; j++) {
1313
const newLocal = i + 1;
14-
1514
const x = /*RENAME*/newLocal;
1615
}
1716
}

tests/baselines/reference/extractConstant/extractConstant_BlockScopes_NoDependencies.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ for (let i = 0; i < 10; i++) {
88
for (let i = 0; i < 10; i++) {
99
for (let j = 0; j < 10; j++) {
1010
const newLocal = 1;
11-
1211
let x = /*RENAME*/newLocal;
1312
}
1413
}

tests/baselines/reference/extractConstant/extractConstant_BlockScopes_NoDependencies.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ for (let i = 0; i < 10; i++) {
88
for (let i = 0; i < 10; i++) {
99
for (let j = 0; j < 10; j++) {
1010
const newLocal = 1;
11-
1211
let x = /*RENAME*/newLocal;
1312
}
1413
}

tests/baselines/reference/extractConstant/extractConstant_ClassInsertionPosition1.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class C {
1616
M2() { }
1717
M3() {
1818
const newLocal = 1;
19-
2019
let x = /*RENAME*/newLocal;
2120
}
2221
}

tests/baselines/reference/extractConstant/extractConstant_ClassInsertionPosition1.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class C {
1616
M2() { }
1717
M3() {
1818
const newLocal = 1;
19-
2019
let x = /*RENAME*/newLocal;
2120
}
2221
}

tests/baselines/reference/extractConstant/extractConstant_ClassInsertionPosition2.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class C {
1616
M2() { }
1717
M3() {
1818
const newLocal = 1;
19-
2019
let x = /*RENAME*/newLocal;
2120
}
2221
}

0 commit comments

Comments
 (0)