mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-17 01:49:41 -05:00
Comment out headers in Extract Method baselines
This commit is contained in:
@@ -577,11 +577,11 @@ namespace A {
|
||||
assert.equal(result.errors, undefined, "expect no errors");
|
||||
const results = refactor.extractMethod.getPossibleExtractions(result.targetRange, context);
|
||||
const data: string[] = [];
|
||||
data.push(`==ORIGINAL==`);
|
||||
data.push(`// ==ORIGINAL==`);
|
||||
data.push(sourceFile.text);
|
||||
for (const r of results) {
|
||||
const changes = refactor.extractMethod.getPossibleExtractions(result.targetRange, context, results.indexOf(r))[0].changes;
|
||||
data.push(`==SCOPE::${r.scopeDescription}==`);
|
||||
data.push(`// ==SCOPE::${r.scopeDescription}==`);
|
||||
data.push(textChanges.applyChanges(sourceFile.text, changes[0].textChanges));
|
||||
}
|
||||
return data.join(newLineCharacter);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
==ORIGINAL==
|
||||
// ==ORIGINAL==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
function foo() {
|
||||
@@ -14,7 +14,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::function 'a'==
|
||||
// ==SCOPE::function 'a'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
function foo() {
|
||||
@@ -34,7 +34,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'B'==
|
||||
// ==SCOPE::namespace 'B'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
function foo() {
|
||||
@@ -55,7 +55,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'A'==
|
||||
// ==SCOPE::namespace 'A'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
function foo() {
|
||||
@@ -76,7 +76,7 @@ namespace A {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
==SCOPE::global scope==
|
||||
// ==SCOPE::global scope==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
function foo() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
==ORIGINAL==
|
||||
// ==ORIGINAL==
|
||||
namespace A {
|
||||
export interface I { x: number };
|
||||
class C {
|
||||
@@ -9,7 +9,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::class 'C'==
|
||||
// ==SCOPE::class 'C'==
|
||||
namespace A {
|
||||
export interface I { x: number };
|
||||
class C {
|
||||
@@ -24,7 +24,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'A'==
|
||||
// ==SCOPE::namespace 'A'==
|
||||
namespace A {
|
||||
export interface I { x: number };
|
||||
class C {
|
||||
@@ -39,7 +39,7 @@ namespace A {
|
||||
return a1.x + 10;
|
||||
}
|
||||
}
|
||||
==SCOPE::global scope==
|
||||
// ==SCOPE::global scope==
|
||||
namespace A {
|
||||
export interface I { x: number };
|
||||
class C {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
==ORIGINAL==
|
||||
// ==ORIGINAL==
|
||||
namespace A {
|
||||
let y = 1;
|
||||
class C {
|
||||
@@ -11,7 +11,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::class 'C'==
|
||||
// ==SCOPE::class 'C'==
|
||||
namespace A {
|
||||
let y = 1;
|
||||
class C {
|
||||
@@ -30,7 +30,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'A'==
|
||||
// ==SCOPE::namespace 'A'==
|
||||
namespace A {
|
||||
let y = 1;
|
||||
class C {
|
||||
@@ -49,7 +49,7 @@ namespace A {
|
||||
return { __return: a1.x + 10, z };
|
||||
}
|
||||
}
|
||||
==SCOPE::global scope==
|
||||
// ==SCOPE::global scope==
|
||||
namespace A {
|
||||
let y = 1;
|
||||
class C {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
==ORIGINAL==
|
||||
// ==ORIGINAL==
|
||||
namespace A {
|
||||
let y = 1;
|
||||
class C {
|
||||
@@ -13,7 +13,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::class 'C'==
|
||||
// ==SCOPE::class 'C'==
|
||||
namespace A {
|
||||
let y = 1;
|
||||
class C {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
==ORIGINAL==
|
||||
// ==ORIGINAL==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
function foo() {
|
||||
@@ -12,7 +12,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::function 'a'==
|
||||
// ==SCOPE::function 'a'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
function foo() {
|
||||
@@ -30,7 +30,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'B'==
|
||||
// ==SCOPE::namespace 'B'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
function foo() {
|
||||
@@ -48,7 +48,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'A'==
|
||||
// ==SCOPE::namespace 'A'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
function foo() {
|
||||
@@ -66,7 +66,7 @@ namespace A {
|
||||
return foo();
|
||||
}
|
||||
}
|
||||
==SCOPE::global scope==
|
||||
// ==SCOPE::global scope==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
function foo() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
==ORIGINAL==
|
||||
// ==ORIGINAL==
|
||||
namespace A {
|
||||
function foo() {
|
||||
}
|
||||
@@ -11,7 +11,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::function 'a'==
|
||||
// ==SCOPE::function 'a'==
|
||||
namespace A {
|
||||
function foo() {
|
||||
}
|
||||
@@ -28,7 +28,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'B'==
|
||||
// ==SCOPE::namespace 'B'==
|
||||
namespace A {
|
||||
function foo() {
|
||||
}
|
||||
@@ -45,7 +45,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'A'==
|
||||
// ==SCOPE::namespace 'A'==
|
||||
namespace A {
|
||||
function foo() {
|
||||
}
|
||||
@@ -62,7 +62,7 @@ namespace A {
|
||||
return foo();
|
||||
}
|
||||
}
|
||||
==SCOPE::global scope==
|
||||
// ==SCOPE::global scope==
|
||||
namespace A {
|
||||
function foo() {
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
==ORIGINAL==
|
||||
// ==ORIGINAL==
|
||||
namespace A {
|
||||
function foo() {
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::function 'a'==
|
||||
// ==SCOPE::function 'a'==
|
||||
namespace A {
|
||||
function foo() {
|
||||
}
|
||||
@@ -32,7 +32,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'B'==
|
||||
// ==SCOPE::namespace 'B'==
|
||||
namespace A {
|
||||
function foo() {
|
||||
}
|
||||
@@ -51,7 +51,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'A'==
|
||||
// ==SCOPE::namespace 'A'==
|
||||
namespace A {
|
||||
function foo() {
|
||||
}
|
||||
@@ -70,7 +70,7 @@ namespace A {
|
||||
return foo();
|
||||
}
|
||||
}
|
||||
==SCOPE::global scope==
|
||||
// ==SCOPE::global scope==
|
||||
namespace A {
|
||||
function foo() {
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
==ORIGINAL==
|
||||
// ==ORIGINAL==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
export function foo() {
|
||||
@@ -14,7 +14,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::function 'a'==
|
||||
// ==SCOPE::function 'a'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
export function foo() {
|
||||
@@ -34,7 +34,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'B'==
|
||||
// ==SCOPE::namespace 'B'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
export function foo() {
|
||||
@@ -55,7 +55,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'A'==
|
||||
// ==SCOPE::namespace 'A'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
export function foo() {
|
||||
@@ -76,7 +76,7 @@ namespace A {
|
||||
return a;
|
||||
}
|
||||
}
|
||||
==SCOPE::global scope==
|
||||
// ==SCOPE::global scope==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
export function foo() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
==ORIGINAL==
|
||||
// ==ORIGINAL==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
export function foo() {
|
||||
@@ -14,7 +14,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::function 'a'==
|
||||
// ==SCOPE::function 'a'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
export function foo() {
|
||||
@@ -34,7 +34,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'B'==
|
||||
// ==SCOPE::namespace 'B'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
export function foo() {
|
||||
@@ -56,7 +56,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'A'==
|
||||
// ==SCOPE::namespace 'A'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
export function foo() {
|
||||
@@ -78,7 +78,7 @@ namespace A {
|
||||
return { __return: foo(), a };
|
||||
}
|
||||
}
|
||||
==SCOPE::global scope==
|
||||
// ==SCOPE::global scope==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
export function foo() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
==ORIGINAL==
|
||||
// ==ORIGINAL==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
export namespace C {
|
||||
@@ -16,7 +16,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::function 'a'==
|
||||
// ==SCOPE::function 'a'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
export namespace C {
|
||||
@@ -38,7 +38,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'B'==
|
||||
// ==SCOPE::namespace 'B'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
export namespace C {
|
||||
@@ -62,7 +62,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'A'==
|
||||
// ==SCOPE::namespace 'A'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
export namespace C {
|
||||
@@ -86,7 +86,7 @@ namespace A {
|
||||
return { __return: C.foo(), a };
|
||||
}
|
||||
}
|
||||
==SCOPE::global scope==
|
||||
// ==SCOPE::global scope==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
export namespace C {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
==ORIGINAL==
|
||||
// ==ORIGINAL==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
namespace B {
|
||||
@@ -8,7 +8,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::function 'a'==
|
||||
// ==SCOPE::function 'a'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
namespace B {
|
||||
@@ -22,7 +22,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'B'==
|
||||
// ==SCOPE::namespace 'B'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
namespace B {
|
||||
@@ -36,7 +36,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'A'==
|
||||
// ==SCOPE::namespace 'A'==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
namespace B {
|
||||
@@ -50,7 +50,7 @@ namespace A {
|
||||
return 1 + a1 + x;
|
||||
}
|
||||
}
|
||||
==SCOPE::global scope==
|
||||
// ==SCOPE::global scope==
|
||||
namespace A {
|
||||
let x = 1;
|
||||
namespace B {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
==ORIGINAL==
|
||||
// ==ORIGINAL==
|
||||
namespace A {
|
||||
export interface I { x: number };
|
||||
namespace B {
|
||||
@@ -8,7 +8,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::function 'a'==
|
||||
// ==SCOPE::function 'a'==
|
||||
namespace A {
|
||||
export interface I { x: number };
|
||||
namespace B {
|
||||
@@ -22,7 +22,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'B'==
|
||||
// ==SCOPE::namespace 'B'==
|
||||
namespace A {
|
||||
export interface I { x: number };
|
||||
namespace B {
|
||||
@@ -36,7 +36,7 @@ namespace A {
|
||||
}
|
||||
}
|
||||
}
|
||||
==SCOPE::namespace 'A'==
|
||||
// ==SCOPE::namespace 'A'==
|
||||
namespace A {
|
||||
export interface I { x: number };
|
||||
namespace B {
|
||||
@@ -50,7 +50,7 @@ namespace A {
|
||||
return a1.x + 10;
|
||||
}
|
||||
}
|
||||
==SCOPE::global scope==
|
||||
// ==SCOPE::global scope==
|
||||
namespace A {
|
||||
export interface I { x: number };
|
||||
namespace B {
|
||||
|
||||
Reference in New Issue
Block a user