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"));

tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment.ts

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

3-
//// var [|{| "isWriteAccess": true, "isDefinition": true |}name|] = "Foo";
3+
//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}name|] = "Foo";|]
44
////
55
//// var obj = { [|{| "isWriteAccess": true, "isDefinition": true |}name|] };
6-
//// var obj1 = { [|{| "isWriteAccess": true, "isDefinition": true |}name|]:[|name|] };
6+
//// var obj1 = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 3 |}name|]:[|name|]|] };
77
//// obj.[|name|];
88

9-
const [r0, r1, r2, r3, r4] = test.ranges();
9+
const [r0Def, r0, r1, r2Def, r2, r3, r4] = test.ranges();
1010
verify.referenceGroups([r0, r3], [{ definition: "var name: string", ranges: [r0, r1, r3] }]);
1111
verify.referenceGroups(r1, [
1212
{ definition: "var name: string", ranges: [r0, r1, r3] },

tests/cases/fourslash/findAllRefsWithShorthandPropertyAssignment2.ts

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

3-
//// var [|{| "isWriteAccess": true, "isDefinition": true |}dx|] = "Foo";
3+
//// [|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}dx|] = "Foo";|]
44
////
5-
//// module M { export var [|{| "isDefinition": true |}dx|]; }
5+
//// module M { [|export var [|{| "isDefinition": true, "declarationRangeIndex": 2 |}dx|];|] }
66
//// module M {
77
//// var z = 100;
88
//// export var y = { [|{| "isWriteAccess": true, "isDefinition": true |}dx|], z };
99
//// }
1010
//// M.y.[|dx|];
1111

12-
const [r0, r1, r2, r3] = test.ranges();
12+
const [r0Def, r0, r1Def, r1, r2, r3] = test.ranges();
1313
verify.singleReferenceGroup("var dx: string", [r0]);
1414
verify.referenceGroups(r1, [{ definition: "var M.dx: any", ranges: [r1, r2] }]);
1515
verify.referenceGroups(r2, [

tests/cases/fourslash/findAllRefs_importType_exportEquals.ts

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

33
// @Filename: /a.ts
4-
////type [|{| "isWriteAccess": true, "isDefinition": true |}T|] = number;
5-
////namespace [|{| "isWriteAccess": true, "isDefinition": true |}T|] {
4+
////[|type [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}T|] = number;|]
5+
////[|namespace [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}T|] {
66
//// export type U = string;
7-
////}
8-
////[|export|] = [|T|];
7+
////}|]
8+
////[|[|export|] = [|{| "declarationRangeIndex": 4 |}T|];|]
99

1010
// @Filename: /b.ts
1111
////const x: import("[|./[|a|]|]") = 0;
1212
////const y: import("[|./[|a|]|]").U = "";
1313

1414
verify.noErrors();
1515

16-
const [r0, r1, rExport, r2, r3, r3b, r4, r4b] = test.ranges();
16+
const [r0Def, r0, r1Def, r1, r2Def, rExport, r2, r3, r3b, r4, r4b] = test.ranges();
1717
verify.referenceGroups(r0, [{ definition: "type T = number\nnamespace T", ranges: [r0, r2, r3] }]);
1818
verify.referenceGroups(r1, [{ definition: "namespace T", ranges: [r1, r2] }]);
1919
const t: FourSlashInterface.ReferenceGroup = { definition: "type T = number\nnamespace T", ranges: [r0, r1, r2, r3] };

tests/cases/fourslash/findAllRefs_importType_js.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// @checkJs: true
55

66
// @Filename: /a.js
7-
////[|module|].exports = class [|{| "isWriteAccess": true, "isDefinition": true |}C|] {};
8-
////module.exports.[|{| "isWriteAccess": true, "isDefinition": true |}D|] = class [|{| "isWriteAccess": true, "isDefinition": true |}D|] {};
7+
////[|[|{| "declarationRangeIndex": 0 |}module|].exports = [|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}C|] {}|];|]
8+
////[|module.exports.[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 4 |}D|] = [|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 6 |}D|] {}|];|]
99

1010
// @Filename: /b.js
1111
/////** @type {import("[|./a|]")} */
@@ -17,7 +17,7 @@ verify.noErrors();
1717

1818
// TODO: GH#24025
1919

20-
const [rModule, r0, r1, r2, r3, r4, r5] = test.ranges();
20+
const [rModuleDef, rModule, r0Def, r0, r1Def, r1, r2Def, r2, r3, r4, r5] = test.ranges();
2121
verify.referenceGroups(rModule, [{ definition: 'module "/a"', ranges: [r3, r4, rModule] }]);
2222
verify.referenceGroups(r0, [
2323
{ definition: "(local class) C", ranges: [r0] },
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/// <reference path='fourslash.ts' />
22

33
// @Filename: /a.ts
4-
////export type [|{| "isWriteAccess": true, "isDefinition": true |}T|] = 0;
5-
////export const [|{| "isWriteAccess": true, "isDefinition": true |}T|] = 0;
4+
////[|export type [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}T|] = 0;|]
5+
////[|export const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}T|] = 0;|]
66

77
// @Filename: /b.ts
88
////const x: import("./a").[|T|] = 0;
99
////const x: typeof import("./a").[|T|] = 0;
1010

11-
const [r0, r1, r2, r3] = test.ranges();
11+
const [r0Def, r0, r1Def, r1, r2, r3] = test.ranges();
1212
verify.singleReferenceGroup("type T = 0", [r0, r2]);
1313
verify.singleReferenceGroup("const T: 0", [r1, r3]);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/// <reference path='fourslash.ts' />
22

33
// @Filename: /a.ts
4-
////export type [|{| "isWriteAccess": true, "isDefinition": true |}T|] = number;
5-
////export type [|{| "isWriteAccess": true, "isDefinition": true |}U|] = string;
4+
////[|export type [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}T|] = number;|]
5+
////[|export type [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}U|] = string;|]
66

77
// @Filename: /b.ts
88
////const x: import("./a").[|T|] = 0;
99
////const x: import("./a").[|U|] = 0;
1010

11-
const [r0, r1, r2, r3] = test.ranges();
11+
const [r0Def, r0, r1Def, r1, r2, r3] = test.ranges();
1212
verify.singleReferenceGroup("type T = number", [r0, r2]);
1313
verify.singleReferenceGroup("type U = string", [r1, r3]);

tests/cases/fourslash/findAllRefs_jsEnum.ts

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

55
// @Filename: /a.js
66
/////** @enum {string} */
7-
////const [|{| "isWriteAccess": true, "isDefinition": true |}E|] = { A: "" };
7+
////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}E|] = { A: "" };|]
88
////[|E|]["A"];
99
/////** @type {[|E|]} */
1010
////const e = [|E|].A;
@@ -13,4 +13,4 @@ verify.singleReferenceGroup(
1313
`enum E
1414
const E: {
1515
A: string;
16-
}`);
16+
}`, test.rangesByText().get("E"));
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path="fourslash.ts" />
22

33
//@Filename: a.ts
4-
////var [|{| "isDefinition": true |}x|]: number;
4+
////[|var [|{| "isDefinition": true, "declarationRangeIndex": 0 |}x|]: number;|]
55

66
//@Filename: b.ts
77
/////// <reference path="a.ts" />
@@ -11,4 +11,4 @@
1111
/////// <reference path="a.ts" />
1212
////[|{| "isWriteAccess": true |}x|]++;
1313

14-
verify.singleReferenceGroup("var x: number");
14+
verify.singleReferenceGroup("var x: number", test.rangesByText().get("x"));

tests/cases/fourslash/findReferencesAfterEdit.ts

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

33
// @Filename: a.ts
44
////interface A {
5-
//// [|{| "isDefinition": true |}foo|]: string;
5+
//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}foo|]: string;|]
66
////}
77

88
// @Filename: b.ts
@@ -12,9 +12,9 @@
1212
//// x.[|foo|]
1313
////}
1414

15-
verify.singleReferenceGroup("(property) A.foo: string");
15+
verify.singleReferenceGroup("(property) A.foo: string", test.rangesByText().get("foo"));
1616

1717
goTo.marker("");
1818
edit.insert("\n");
1919

20-
verify.singleReferenceGroup("(property) A.foo: string");
20+
verify.singleReferenceGroup("(property) A.foo: string", test.rangesByText().get("foo"));

tests/cases/fourslash/findReferencesJSXTagName.ts

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
// @Filename: index.tsx
4-
////import { [|{| "isWriteAccess": true, "isDefinition": true |}SubmissionComp|] } from "./RedditSubmission"
4+
////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}SubmissionComp|] } from "./RedditSubmission"|]
55
////function displaySubreddit(subreddit: string) {
66
//// let components = submissions
77
//// .map((value, index) => <[|SubmissionComp|] key={ index } elementPosition= { index } {...value.data} />);
88
////}
99

1010
// @Filename: RedditSubmission.ts
11-
////export const [|{| "isWriteAccess": true, "isDefinition": true |}SubmissionComp|] = (submission: SubmissionProps) =>
12-
//// <div style={{ fontFamily: "sans-serif" }}></div>;
11+
////export const [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 3 |}SubmissionComp|] = (submission: SubmissionProps) =>
12+
//// <div style|]={{ fontFamily: "sans-serif" }}></div>;
1313

14-
const [r0, r1, r2] = test.ranges();
14+
const [r0Def, r0, r1, r2Def, r2] = test.ranges();
1515
const imports = { definition: "(alias) const SubmissionComp: (submission: any) => any\nimport SubmissionComp", ranges: [r0, r1] };
1616
const def = { definition: "const SubmissionComp: (submission: any) => any", ranges: [r2] };
1717
verify.referenceGroups([r0, r1], [imports, def]);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/// <reference path='fourslash.ts'/>
22

33
// @Filename: index.tsx
4-
////const [|{| "isWriteAccess": true, "isDefinition": true |}obj|] = {Component: () => <div/>};
4+
////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}obj|] = {Component: () => <div/>};|]
55
////const element = <[|obj|].Component/>;
66

77
verify.singleReferenceGroup(`const obj: {
88
Component: () => any;
9-
}`);
9+
}`, test.rangesByText().get("obj"));

tests/cases/fourslash/findReferencesJSXTagName3.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,21 @@
66
////namespace JSX {
77
//// export interface Element { }
88
//// export interface IntrinsicElements {
9-
//// [|{| "isDefinition": true |}div|]: any;
9+
//// [|[|{| "isDefinition": true, "declarationRangeIndex": 0 |}div|]: any;|]
1010
//// }
1111
////}
1212
////
13-
////const [|{| "isWriteAccess": true, "isDefinition": true |}Comp|] = () =>
13+
////[|const [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}Comp|] = () =>
1414
//// <[|div|]>
1515
//// Some content
1616
//// <[|div|]>More content</[|div|]>
17-
//// </[|div|]>;
17+
//// </[|div|]>;|]
1818
////
1919
////const x = <[|Comp|]>
2020
//// Content
2121
////</[|Comp|]>;
2222

23-
const ranges = test.ranges();
24-
const [d0, c0, d1, d2, d3, d4, c1, c2] = test.ranges();
23+
const [d0Def, d0, c0Def, c0, d1, d2, d3, d4, c1, c2] = test.ranges();
2524

2625
const allD = [d0, d1, d2, d3, d4];
2726
const allC = [c0, c1, c2];
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// <reference path='fourslash.ts' />
2-
////var [|{| "isWriteAccess": true, "isDefinition": true |}f|] = x => x + 1;
2+
////[|var [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}f|] = x => x + 1;|]
33
////[|f|](12);
44

5-
verify.singleReferenceGroup("var f: (x: any) => any");
5+
verify.singleReferenceGroup("var f: (x: any) => any", test.rangesByText().get("f"));

tests/cases/fourslash/getOccurrencesIsDefinitionOfBindingPattern.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/// <reference path='fourslash.ts' />
2-
////const { [|{| "isWriteAccess": true, "isDefinition": true |}x|], y } = { [|{| "isWriteAccess": true, "isDefinition": true |}x|]: 1, y: 2 };
2+
////[|const { [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}x|], y } = { [|[|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 2 |}x|]: 1|], y: 2 };|]
33
////const z = [|x|];
44

5-
const [r0, r1, r2] = test.ranges();
5+
const [r0Def, r0, r1Def, r1, r2] = test.ranges();
66
const local = { definition: "const x: number", ranges: [r0, r2] };
77
const prop = { definition: "(property) x: number", ranges: [r1] };
88
verify.referenceGroups(r0, [local, prop]);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/// <reference path='fourslash.ts' />
2-
////class [|{| "isWriteAccess": true, "isDefinition": true |}C|] {
2+
////[|class [|{| "isWriteAccess": true, "isDefinition": true, "declarationRangeIndex": 0 |}C|] {
33
//// n: number;
44
//// constructor() {
55
//// this.n = 12;
66
//// }
7-
////}
7+
////}|]
88
////let c = new [|C|]();
99

10-
verify.singleReferenceGroup("class C");
10+
verify.singleReferenceGroup("class C", test.rangesByText().get("C"));

0 commit comments

Comments
 (0)