Skip to content

Commit cc1cb54

Browse files
committed
More tests
1 parent eaeeb06 commit cc1cb54

File tree

37 files changed

+104
-105
lines changed

37 files changed

+104
-105
lines changed

tests/cases/fourslash/findAllRefsUnionProperty.ts

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

33
////type T =
4-
//// | { [|{| "isDefinition": true |}type|]: "a", [|{| "isDefinition": true |}prop|]: number }
5-
//// | { [|{| "isDefinition": true |}type|]: "b", [|{| "isDefinition": true |}prop|]: string };
4+
//// | { [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}type|]: "a",|] [|[|{| "isDefinition": true, "declarationRangeIndex": 2 |}prop|]: number|] }
5+
//// | { [|[|{| "isDefinition": true, "declarationRangeIndex": 4 |}type|]: "b",|] [|[|{| "isDefinition": true, "declarationRangeIndex": 6 |}prop|]: string|] };
66
////const tt: T = {
7-
//// [|{| "isWriteAccess": true, "isDefinition": true |}type|]: "a",
8-
//// [|{| "isWriteAccess": true, "isDefinition": true |}prop|]: 0,
7+
//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 8 |}type|]: "a"|],
8+
//// [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 10 |}prop|]: 0|],
99
////};
1010
////declare const t: T;
1111
////if (t.[|type|] === "a") {
@@ -14,7 +14,7 @@
1414
//// t.[|type|];
1515
////}
1616

17-
const [t0, p0, t1, p1, t2, p2, t3, t4, t5] = test.ranges();
17+
const [t0Def, t0, p0Def, p0, t1Def, t1, p1Def, p1, t2Def, t2, p2Def, p2, t3, t4, t5] = test.ranges();
1818

1919
const a = { definition: { text: '(property) type: "a"', range: t0 }, ranges: [t0, t2, t4] };
2020
const b = { definition: { text: '(property) type: "b"', range: t1 }, ranges: [t1, t5] };
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/// <reference path='fourslash.ts'/>
22

33
////class Foo {
4-
//// public [|{| "isWriteAccess": true, "isDefinition": true |}_bar|]() { return 0; }
4+
//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}_bar|]() { return 0; }|]
55
////}
66
////
77
////var x: Foo;
88
////x.[|_bar|];
99

10-
verify.singleReferenceGroup("(method) Foo._bar(): number");
10+
verify.singleReferenceGroup("(method) Foo._bar(): number", test.rangesByText().get("_bar"));
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/// <reference path='fourslash.ts'/>
22

33
////class Foo {
4-
//// public [|{| "isWriteAccess": true, "isDefinition": true |}__bar|]() { return 0; }
4+
//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}__bar|]() { return 0; }|]
55
////}
66
////
77
////var x: Foo;
88
////x.[|__bar|];
99

10-
verify.singleReferenceGroup("(method) Foo.__bar(): number");
10+
verify.singleReferenceGroup("(method) Foo.__bar(): number", test.rangesByText().get("__bar"));
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/// <reference path='fourslash.ts'/>
22

33
////class Foo {
4-
//// public [|{| "isWriteAccess": true, "isDefinition": true |}___bar|]() { return 0; }
4+
//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}___bar|]() { return 0; }|]
55
////}
66
////
77
////var x: Foo;
88
////x.[|___bar|];
99

10-
verify.singleReferenceGroup("(method) Foo.___bar(): number");
10+
verify.singleReferenceGroup("(method) Foo.___bar(): number", test.rangesByText().get("___bar"));
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/// <reference path='fourslash.ts'/>
22

33
////class Foo {
4-
//// public [|{| "isWriteAccess": true, "isDefinition": true |}____bar|]() { return 0; }
4+
//// [|public [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}____bar|]() { return 0; }|]
55
////}
66
////
77
////var x: Foo;
88
////x.[|____bar|];
99

10-
verify.singleReferenceGroup("(method) Foo.____bar(): number");
10+
verify.singleReferenceGroup("(method) Foo.____bar(): number", test.rangesByText().get("____bar"));

tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames5.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
////class Foo {
44
//// public _bar;
55
//// public __bar;
6-
//// public [|{| "isDefinition": true |}___bar|];
6+
//// [|public [|{| "isDefinition": true, "declarationRangeIndex": 0 |}___bar|];|]
77
//// public ____bar;
88
////}
99
////
@@ -13,4 +13,4 @@
1313
////x.[|___bar|];
1414
////x.____bar;
1515

16-
verify.singleReferenceGroup("(property) Foo.___bar: any");
16+
verify.singleReferenceGroup("(property) Foo.___bar: any", test.rangesByText().get("___bar"));

tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames6.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
////class Foo {
44
//// public _bar;
5-
//// public [|{| "isDefinition": true |}__bar|];
5+
//// [|public [|{| "isDefinition": true, "declarationRangeIndex": 0 |}__bar|];|]
66
//// public ___bar;
77
//// public ____bar;
88
////}
@@ -13,4 +13,4 @@
1313
////x.___bar;
1414
////x.____bar;
1515

16-
verify.singleReferenceGroup("(property) Foo.__bar: any");
16+
verify.singleReferenceGroup("(property) Foo.__bar: any", test.rangesByText().get("__bar"));
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path='fourslash.ts' />
22

3-
////function [|{| "isWriteAccess": true, "isDefinition": true |}__foo|]() {
3+
////[|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}__foo|]() {
44
//// [|__foo|]();
5-
////}
5+
////}|]
66

7-
verify.singleReferenceGroup("function __foo(): void");
7+
verify.singleReferenceGroup("function __foo(): void", test.rangesByText().get("__foo"));
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path='fourslash.ts' />
22

3-
////(function [|{| "isWriteAccess": true, "isDefinition": true |}__foo|]() {
3+
////([|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}__foo|]() {
44
//// [|__foo|]();
5-
////})
5+
////}|])
66

7-
verify.singleReferenceGroup("(local function) __foo(): void");
7+
verify.singleReferenceGroup("(local function) __foo(): void", test.rangesByText().get("__foo"));
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path='fourslash.ts' />
22

3-
////(function [|{| "isWriteAccess": true, "isDefinition": true |}___foo|]() {
3+
////([|function [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}___foo|]() {
44
//// [|___foo|]();
5-
////})
5+
////}|])
66

7-
verify.singleReferenceGroup("(local function) ___foo(): void");
7+
verify.singleReferenceGroup("(local function) ___foo(): void", test.rangesByText().get("___foo"));

0 commit comments

Comments
 (0)