File: findAllRefsInheritedProperties3.ts

package info (click to toggle)
node-typescript 4.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 396,552 kB
  • sloc: javascript: 1,444,377; makefile: 7; sh: 3
file content (46 lines) | stat: -rw-r--r-- 2,261 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/// <reference path='fourslash.ts'/>

//// class class1 extends class1 {
////     [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}doStuff|]() { }|]     // r0
////     [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}propName|]: string;|] // r1
//// }
//// interface interface1 extends interface1 {
////     [|[|{| "isDefinition": true, "contextRangeIndex": 4 |}doStuff|](): void;|]   // r2
////     [|[|{| "isDefinition": true, "contextRangeIndex": 6 |}propName|]: string;|]  // r3
//// }
//// class class2 extends class1 implements interface1 {
////     [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 8 |}doStuff|]() { }|]      // r4
////     [|[|{| "isDefinition": true, "contextRangeIndex": 10 |}propName|]: string;|]  // r5
//// }
////
//// var v: class2;
//// v.[|doStuff|]();  // r6
//// v.[|propName|];   // r7

const [r0Def, r0, r1Def, r1, r2Def, r2, r3Def, r3, r4Def, r4, r5Def, r5, r6, r7] = test.ranges();
verify.referenceGroups(r0, [
    { definition: "(method) class1.doStuff(): void", ranges: [r0] },
    { definition: "(method) class2.doStuff(): void", ranges: [r4, r6] },
]);
verify.referenceGroups(r1, [
    { definition: "(property) class1.propName: string", ranges: [r1] },
    { definition: "(property) class2.propName: string", ranges: [r5, r7] },
]);
verify.referenceGroups(r2, [
    { definition: "(method) interface1.doStuff(): void", ranges: [r2] },
    { definition: "(method) class2.doStuff(): void", ranges: [r4, r6] },
]);
verify.referenceGroups(r3, [
    { definition: "(property) interface1.propName: string", ranges: [r3] },
    { definition: "(property) class2.propName: string", ranges: [r5, r7] },
]);
verify.referenceGroups([r4, r6], [
    { definition: "(method) class1.doStuff(): void", ranges: [r0] },
    { definition: "(method) interface1.doStuff(): void", ranges: [r2] },
    { definition: "(method) class2.doStuff(): void", ranges: [r4, r6] }
]);
verify.referenceGroups([r5, r7], [
    { definition: "(property) class1.propName: string", ranges: [r1] },
    { definition: "(property) interface1.propName: string", ranges: [r3] },
    { definition: "(property) class2.propName: string", ranges: [r5, r7] }
]);