Skip to content

Commit c0537d9

Browse files
committed
More tests
1 parent dfb613c commit c0537d9

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
/// <reference path='fourslash.ts' />
22

33
////class A {
4-
//// [|foo|]: string;
4+
//// [|[|{| "declarationRangeIndex": 0 |}foo|]: string;|]
55
////}
66
////class B {
77
//// syntax1(a: A): void {
8-
//// let { [|foo|] } = a;
8+
//// [|let { [|{| "declarationRangeIndex": 2 |}foo|] } = a;|]
99
//// }
1010
//// syntax2(a: A): void {
11-
//// let { [|foo|]: foo } = a;
11+
//// [|let { [|{| "declarationRangeIndex": 4 |}foo|]: foo } = a;|]
1212
//// }
1313
//// syntax11(a: A): void {
14-
//// let { [|foo|] } = a;
14+
//// [|let { [|{| "declarationRangeIndex": 6 |}foo|] } = a;|]
1515
//// [|foo|] = "newString";
1616
//// }
1717
////}
1818

19-
const [r0, r1, r2, r3, r4] = test.ranges();
19+
const [r0Def, r0, r1Def, r1, r2Def, r2, r3Def, r3, r4] = test.ranges();
2020
verify.renameLocations([r0, r2], [r0, { range: r1, suffixText: ": foo" }, r2, { range: r3, suffixText: ": foo" }]);
2121
verify.renameLocations(r1, [{ range: r1, prefixText: "foo: " }]);
2222
verify.renameLocations([r3, r4], [{ range: r3, prefixText: "foo: " }, r4]);
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/// <reference path='fourslash.ts' />
22

33
////interface I {
4-
//// [|property1|]: number;
4+
//// [|[|{| "declarationRangeIndex": 0 |}property1|]: number;|]
55
//// property2: string;
66
////}
77
////var elems: I[];
88
////
99
////var p2: number, property1: number;
10-
////for (let { [|property1|]: p2 } = elems[0]; p2 < 100; p2++) {
10+
////for ([|let { [|{| "declarationRangeIndex": 2 |}property1|]: p2 } = elems[0]|]; p2 < 100; p2++) {
1111
////}
12-
////for (let { [|property1|] } = elems[0]; p2 < 100; p2++) {
12+
////for ([|let { [|{| "declarationRangeIndex": 4 |}property1|] } = elems[0]|]; p2 < 100; p2++) {
1313
//// [|property1|] = p2;
1414
////}
1515

16-
const [r0, r1, r2, r3] = test.ranges();
16+
const [r0Def, r0, r1Def, r1, r2Def, r2, r3] = test.ranges();
1717
verify.renameLocations([r0, r1], [r0, r1, { range: r2, suffixText: ": property1" }]);
1818
verify.renameLocations([r2, r3], [{ range: r2, prefixText: "property1: " }, r3]);
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/// <reference path='fourslash.ts' />
22

33
////interface I {
4-
//// [|property1|]: number;
4+
//// [|[|{| "declarationRangeIndex": 0 |}property1|]: number;|]
55
//// property2: string;
66
////}
77
////var elems: I[];
88
////
9-
////for (let { [|property1|] } of elems) {
9+
////for ([|let { [|{| "declarationRangeIndex": 2 |}property1|] } of elems|]) {
1010
//// [|property1|]++;
1111
////}
12-
////for (let { [|property1|]: p2 } of elems) {
12+
////for ([|let { [|{| "declarationRangeIndex": 5 |}property1|]: p2 } of elems|]) {
1313
////}
1414

15-
const [r0, r1, r2, r3] = test.ranges();
15+
const [r0Def, r0, r1Def, r1, r2, r3Def, r3] = test.ranges();
1616
verify.renameLocations([r0, r3], [r0, { range: r1, suffixText: ": property1" }, r3]);
1717
verify.renameLocations([r1, r2], [{ range: r1, prefixText: "property1: " }, r2]);

tests/cases/fourslash/renameDestructuringFunctionParameter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/// <reference path='fourslash.ts' />
22

3-
////function f({[|a|]}: {[|a|]}) {
3+
////function f([|{[|{| "declarationRangeIndex": 0 |}a|]}: {[|{| "declarationRangeIndex": 2 |}a|]}|]) {
44
//// f({[|a|]});
55
////}
66

7-
const [r0, r1, r2] = test.ranges();
7+
const [r0Def, r0, r1, r2] = test.ranges();
88
// renames the local
99
verify.renameLocations([r0, r2], [{ range: r0, prefixText: "a: " }, { range: r2, prefixText: "a: " }]);
1010
// renames the property

0 commit comments

Comments
 (0)