File: findAllRefsForStaticInstancePropertyInheritance.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 (37 lines) | stat: -rw-r--r-- 1,165 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
/// <reference path='fourslash.ts'/>

////class X{
////	[|[|{| "isDefinition": true, "contextRangeIndex": 0|}foo|]:any|]
////}
////
////class Y extends X{
////	[|static [|{| "isDefinition": true, "contextRangeIndex": 2|}foo|]:any|]
////}
////
////class Z extends Y{
////	[|static [|{| "isDefinition": true, "contextRangeIndex": 4|}foo|]:any|]
////	[|[|{| "isDefinition": true, "contextRangeIndex": 6|}foo|]:any|]
////}
////
////const x = new X();
////const y = new Y();
////const z = new Z();
////x.[|foo|];
////y.[|foo|];
////z.[|foo|];
////Y.[|foo|];
////Z.[|foo|];

const [r0Def, r0, r1Def, r1, r2Def, r2, r3Def, r3, r4, r5, r6, r7, r8] = test.ranges();
verify.referenceGroups([r0, r3, r4, r5, r6], [
    { definition: { text: '(property) X.foo: any', range: r0 }, ranges: [r0, r4, r5] },
    { definition: { text: '(property) Z.foo: any', range: r3 }, ranges: [r3, r6] },
]);

verify.referenceGroups([r1, r7], [
    { definition: { text: '(property) Y.foo: any', range: r1 }, ranges: [r1, r7] },
]);

verify.referenceGroups([r2, r8], [
    { definition: { text: '(property) Z.foo: any', range: r2 }, ranges: [r2, r8] },
]);