2014-10-09 08:21:56 +02:00
|
|
|
/// <reference path='fourslash.ts'/>
|
|
|
|
|
|
|
|
////interface One {
|
2019-06-13 21:25:02 +02:00
|
|
|
//// common: { [|[|{| "isDefinition": true, "contextRangeIndex": 0 |}a|]: number;|] };
|
2014-10-09 08:21:56 +02:00
|
|
|
////}
|
|
|
|
////
|
2015-03-02 23:41:44 +01:00
|
|
|
////interface Base {
|
2019-06-13 21:25:02 +02:00
|
|
|
//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}a|]: string;|]
|
2015-03-02 23:41:44 +01:00
|
|
|
//// b: string;
|
|
|
|
////}
|
2014-10-09 08:21:56 +02:00
|
|
|
////
|
2015-03-02 23:41:44 +01:00
|
|
|
////interface HasAOrB extends Base {
|
2019-06-13 21:25:02 +02:00
|
|
|
//// [|[|{| "isDefinition": true, "contextRangeIndex": 4 |}a|]: string;|]
|
2015-03-02 23:41:44 +01:00
|
|
|
//// b: string;
|
|
|
|
////}
|
2014-10-09 08:21:56 +02:00
|
|
|
////
|
|
|
|
////interface Two {
|
|
|
|
//// common: HasAOrB;
|
|
|
|
////}
|
|
|
|
////
|
|
|
|
////var x : One | Two;
|
|
|
|
////
|
2016-06-18 01:40:26 +02:00
|
|
|
////x.common.[|a|];
|
2014-10-09 08:21:56 +02:00
|
|
|
|
2019-06-03 23:13:47 +02:00
|
|
|
const [oneDef, one, baseDef, base, hasAOrBDef, hasAOrB, x] = test.ranges();
|
2018-03-19 19:58:20 +01:00
|
|
|
verify.referenceGroups(one, [
|
|
|
|
{ definition: "(property) a: number", ranges: [one] },
|
|
|
|
{ definition: "(property) a: string | number", ranges: [x] },
|
|
|
|
]);
|
2018-04-05 19:55:55 +02:00
|
|
|
verify.referenceGroups([base, hasAOrB], [
|
2017-01-27 17:59:33 +01:00
|
|
|
{ definition: "(property) Base.a: string", ranges: [base] },
|
2018-03-19 19:58:20 +01:00
|
|
|
{ definition: "(property) HasAOrB.a: string", ranges: [hasAOrB] },
|
|
|
|
{ definition: "(property) a: string | number", ranges: [x] },
|
2017-01-27 17:59:33 +01:00
|
|
|
]);
|
|
|
|
verify.referenceGroups(x, [
|
2018-03-19 19:58:20 +01:00
|
|
|
{ definition: "(property) a: number", ranges: [one] },
|
2017-01-27 17:59:33 +01:00
|
|
|
{ definition: "(property) Base.a: string", ranges: [base] },
|
|
|
|
{ definition: "(property) HasAOrB.a: string", ranges: [hasAOrB] },
|
2018-03-19 19:58:20 +01:00
|
|
|
{ definition: "(property) a: string | number", ranges: [x] },
|
2017-01-27 17:59:33 +01:00
|
|
|
]);
|