Skip to content

Commit 1507547

Browse files
authored
Merge pull request microsoft#18927 from amcasey/ExtractBaselineShowRange
Include range markers in Extract Constant/Function baselines
2 parents d1015bf + a10274a commit 1507547

File tree

108 files changed

+128
-128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+128
-128
lines changed

src/harness/unittests/extractTestHelpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ namespace ts {
135135
Harness.Baseline.runBaseline(`${baselineFolder}/${caption}${extension}`, () => {
136136
const data: string[] = [];
137137
data.push(`// ==ORIGINAL==`);
138-
data.push(sourceFile.text);
138+
data.push(text.replace("[#|", "/*[#|*/").replace("|]", "/*|]*/"));
139139
for (const action of actions) {
140140
const { renameLocation, edits } = refactor.extractSymbol.getEditsForAction(context, action.name);
141141
assert.lengthOf(edits, 1);

tests/baselines/reference/extractConstant/extractConstant_ArrowFunction_Block.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==ORIGINAL==
22

33
const f = () => {
4-
return 2 + 1;
4+
return /*[#|*/2 + 1/*|]*/;
55
};
66
// ==SCOPE::Extract to constant in enclosing scope==
77

tests/baselines/reference/extractConstant/extractConstant_ArrowFunction_Block.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==ORIGINAL==
22

33
const f = () => {
4-
return 2 + 1;
4+
return /*[#|*/2 + 1/*|]*/;
55
};
66
// ==SCOPE::Extract to constant in enclosing scope==
77

tests/baselines/reference/extractConstant/extractConstant_ArrowFunction_Expression.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ==ORIGINAL==
2-
const f = () => 2 + 1;
2+
const f = () => /*[#|*/2 + 1/*|]*/;
33
// ==SCOPE::Extract to constant in global scope==
44
const newLocal = 2 + 1;
55

tests/baselines/reference/extractConstant/extractConstant_ArrowFunction_Expression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ==ORIGINAL==
2-
const f = () => 2 + 1;
2+
const f = () => /*[#|*/2 + 1/*|]*/;
33
// ==SCOPE::Extract to constant in global scope==
44
const newLocal = 2 + 1;
55

tests/baselines/reference/extractConstant/extractConstant_BlockScopeMismatch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
for (let i = 0; i < 10; i++) {
44
for (let j = 0; j < 10; j++) {
5-
const x = i + 1;
5+
const x = /*[#|*/i + 1/*|]*/;
66
}
77
}
88

tests/baselines/reference/extractConstant/extractConstant_BlockScopeMismatch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
for (let i = 0; i < 10; i++) {
44
for (let j = 0; j < 10; j++) {
5-
const x = i + 1;
5+
const x = /*[#|*/i + 1/*|]*/;
66
}
77
}
88

tests/baselines/reference/extractConstant/extractConstant_BlockScopes_NoDependencies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==ORIGINAL==
22
for (let i = 0; i < 10; i++) {
33
for (let j = 0; j < 10; j++) {
4-
let x = 1;
4+
let x = /*[#|*/1/*|]*/;
55
}
66
}
77
// ==SCOPE::Extract to constant in enclosing scope==

tests/baselines/reference/extractConstant/extractConstant_BlockScopes_NoDependencies.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==ORIGINAL==
22
for (let i = 0; i < 10; i++) {
33
for (let j = 0; j < 10; j++) {
4-
let x = 1;
4+
let x = /*[#|*/1/*|]*/;
55
}
66
}
77
// ==SCOPE::Extract to constant in enclosing scope==

tests/baselines/reference/extractConstant/extractConstant_Class.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==ORIGINAL==
22
class C {
3-
x = 1;
3+
x = /*[#|*/1/*|]*/;
44
}
55
// ==SCOPE::Extract to constant in global scope==
66
const newLocal = 1;

0 commit comments

Comments
 (0)