Don't insert a blank line after extracted locals

Still insert a blank line after extracted properties.
This commit is contained in:
Andrew Casey
2017-12-15 15:11:16 -08:00
parent a3ab1ffcff
commit e9ac87c2d6
40 changed files with 1 additions and 46 deletions
+1 -1
View File
@@ -1080,7 +1080,7 @@ namespace ts.refactor.extractSymbol {
changeTracker.insertNodeAtTopOfFile(context.file, newVariableStatement);
}
else {
changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ true);
changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false);
}
// Consume
@@ -7,7 +7,6 @@ const f = () => {
const f = () => {
const newLocal = 2 + 1;
return /*RENAME*/newLocal;
};
// ==SCOPE::Extract to constant in global scope==
@@ -7,7 +7,6 @@ const f = () => {
const f = () => {
const newLocal = 2 + 1;
return /*RENAME*/newLocal;
};
// ==SCOPE::Extract to constant in global scope==
@@ -11,7 +11,6 @@ for (let i = 0; i < 10; i++) {
for (let i = 0; i < 10; i++) {
for (let j = 0; j < 10; j++) {
const newLocal = i + 1;
const x = /*RENAME*/newLocal;
}
}
@@ -11,7 +11,6 @@ for (let i = 0; i < 10; i++) {
for (let i = 0; i < 10; i++) {
for (let j = 0; j < 10; j++) {
const newLocal = i + 1;
const x = /*RENAME*/newLocal;
}
}
@@ -8,7 +8,6 @@ for (let i = 0; i < 10; i++) {
for (let i = 0; i < 10; i++) {
for (let j = 0; j < 10; j++) {
const newLocal = 1;
let x = /*RENAME*/newLocal;
}
}
@@ -8,7 +8,6 @@ for (let i = 0; i < 10; i++) {
for (let i = 0; i < 10; i++) {
for (let j = 0; j < 10; j++) {
const newLocal = 1;
let x = /*RENAME*/newLocal;
}
}
@@ -16,7 +16,6 @@ class C {
M2() { }
M3() {
const newLocal = 1;
let x = /*RENAME*/newLocal;
}
}
@@ -16,7 +16,6 @@ class C {
M2() { }
M3() {
const newLocal = 1;
let x = /*RENAME*/newLocal;
}
}
@@ -16,7 +16,6 @@ class C {
M2() { }
M3() {
const newLocal = 1;
let x = /*RENAME*/newLocal;
}
}
@@ -16,7 +16,6 @@ class C {
M2() { }
M3() {
const newLocal = 1;
let x = /*RENAME*/newLocal;
}
}
@@ -16,7 +16,6 @@ class C {
M2() { }
M3() {
const newLocal = 1;
let x = /*RENAME*/newLocal;
}
}
@@ -16,7 +16,6 @@ class C {
M2() { }
M3() {
const newLocal = 1;
let x = /*RENAME*/newLocal;
}
}
@@ -9,6 +9,5 @@ const x = /*[#|*/2 + 1/*|]*/;
"strict";
const newLocal = 2 + 1;
const x = /*RENAME*/newLocal;
@@ -9,6 +9,5 @@ const x = /*[#|*/2 + 1/*|]*/;
"strict";
const newLocal = 2 + 1;
const x = /*RENAME*/newLocal;
@@ -16,7 +16,6 @@ function F() {
let i = 0;
const /*RENAME*/newLocal = i++;
function F() {
}
@@ -16,7 +16,6 @@ function F() {
let i = 0;
const /*RENAME*/newLocal = i++;
function F() {
}
@@ -5,7 +5,6 @@ function F() {
// ==SCOPE::Extract to constant in enclosing scope==
function F() {
const newLocal = 1;
let x = /*RENAME*/newLocal;
}
// ==SCOPE::Extract to constant in global scope==
@@ -5,7 +5,6 @@ function F() {
// ==SCOPE::Extract to constant in enclosing scope==
function F() {
const newLocal = 1;
let x = /*RENAME*/newLocal;
}
// ==SCOPE::Extract to constant in global scope==
@@ -8,7 +8,6 @@ class C {
class C {
M() {
const newLocal = 1;
let x = /*RENAME*/newLocal;
}
}
@@ -8,7 +8,6 @@ class C {
class C {
M() {
const newLocal = 1;
let x = /*RENAME*/newLocal;
}
}
@@ -17,6 +17,5 @@ const x = /*[#|*/2 + 1/*|]*/;
"strict";
const newLocal = 2 + 1;
const x = /*RENAME*/newLocal;
@@ -17,6 +17,5 @@ const x = /*[#|*/2 + 1/*|]*/;
"strict";
const newLocal = 2 + 1;
const x = /*RENAME*/newLocal;
@@ -5,7 +5,6 @@ namespace N {
// ==SCOPE::Extract to constant in enclosing scope==
namespace N {
const newLocal = 1;
let x = /*RENAME*/newLocal;
}
// ==SCOPE::Extract to constant in global scope==
@@ -7,6 +7,5 @@ function F() {
function F() {
let w = 1;
const newLocal = w + 1;
let x = /*RENAME*/newLocal;
}
@@ -7,6 +7,5 @@ function F() {
function F() {
let w = 1;
const newLocal = w + 1;
let x = /*RENAME*/newLocal;
}
@@ -7,7 +7,6 @@ namespace X {
namespace X {
export const j = 10;
const newLocal = j * j;
export const y = /*RENAME*/newLocal;
}
// ==SCOPE::Extract to constant in global scope==
@@ -10,7 +10,6 @@ for (let j = 0; j < 10; j++) {
const i = 0;
for (let j = 0; j < 10; j++) {
const newLocal = i + 1;
const x = /*RENAME*/newLocal;
}
@@ -10,7 +10,6 @@ for (let j = 0; j < 10; j++) {
const i = 0;
for (let j = 0; j < 10; j++) {
const newLocal = i + 1;
const x = /*RENAME*/newLocal;
}
@@ -13,7 +13,6 @@ const i = 0;
function F() {
for (let j = 0; j < 10; j++) {
const newLocal = i + 1;
const x = /*RENAME*/newLocal;
}
}
@@ -22,7 +21,6 @@ function F() {
const i = 0;
const newLocal = i + 1;
function F() {
for (let j = 0; j < 10; j++) {
const x = /*RENAME*/newLocal;
@@ -13,7 +13,6 @@ const i = 0;
function F() {
for (let j = 0; j < 10; j++) {
const newLocal = i + 1;
const x = /*RENAME*/newLocal;
}
}
@@ -22,7 +21,6 @@ function F() {
const i = 0;
const newLocal = i + 1;
function F() {
for (let j = 0; j < 10; j++) {
const x = /*RENAME*/newLocal;
@@ -8,7 +8,6 @@ for (let j = 0; j < 10; j++) {
for (let j = 0; j < 10; j++) {
const newLocal = 2 + 1;
const x = /*RENAME*/newLocal;
}
@@ -8,7 +8,6 @@ for (let j = 0; j < 10; j++) {
for (let j = 0; j < 10; j++) {
const newLocal = 2 + 1;
const x = /*RENAME*/newLocal;
}
@@ -11,7 +11,6 @@ function F() {
function F() {
for (let j = 0; j < 10; j++) {
const newLocal = 2 + 1;
const x = /*RENAME*/newLocal;
}
}
@@ -11,7 +11,6 @@ function F() {
function F() {
for (let j = 0; j < 10; j++) {
const newLocal = 2 + 1;
const x = /*RENAME*/newLocal;
}
}
@@ -12,7 +12,6 @@ function F0() {
function F0() {
function F1() {
const newLocal = 2 + 1;
function F2(x = /*RENAME*/newLocal) {
}
}
@@ -22,7 +21,6 @@ function F0() {
function F0() {
const newLocal = 2 + 1;
function F1() {
function F2(x = /*RENAME*/newLocal) {
}
@@ -12,7 +12,6 @@ function F0() {
function F0() {
function F1() {
const newLocal = 2 + 1;
function F2(x = /*RENAME*/newLocal) {
}
}
@@ -22,7 +21,6 @@ function F0() {
function F0() {
const newLocal = 2 + 1;
function F1() {
function F2(x = /*RENAME*/newLocal) {
}
@@ -16,7 +16,6 @@ class C {
M() {
for (let j = 0; j < 10; j++) {
const newLocal = i + 1;
x = /*RENAME*/newLocal;
}
}
@@ -26,7 +25,6 @@ class C {
const i = 0;
const newLocal = i + 1;
class C {
M() {
for (let j = 0; j < 10; j++) {
@@ -16,7 +16,6 @@ class C {
M() {
for (let j = 0; j < 10; j++) {
const newLocal: any = i + 1;
x = /*RENAME*/newLocal;
}
}
@@ -39,7 +38,6 @@ class C {
const i = 0;
const newLocal: any = i + 1;
class C {
M() {
for (let j = 0; j < 10; j++) {
@@ -5,6 +5,5 @@ function F<T>(t: T) {
// ==SCOPE::Extract to constant in enclosing scope==
function F<T>(t: T) {
const newLocal = t + 1;
let x = /*RENAME*/newLocal;
}