2015-12-23 05:26:54 +01:00
|
|
|
|
/// <reference path='fourslash.ts'/>
|
|
|
|
|
|
|
|
|
|
//// class class1 extends class1 {
|
2019-06-13 21:25:02 +02:00
|
|
|
|
//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}doStuff|]() { }|] // r0
|
|
|
|
|
//// [|[|{| "isDefinition": true, "contextRangeIndex": 2 |}propName|]: string;|] // r1
|
2015-12-23 05:26:54 +01:00
|
|
|
|
//// }
|
|
|
|
|
//// interface interface1 extends interface1 {
|
2019-06-13 21:25:02 +02:00
|
|
|
|
//// [|[|{| "isDefinition": true, "contextRangeIndex": 4 |}doStuff|](): void;|] // r2
|
|
|
|
|
//// [|[|{| "isDefinition": true, "contextRangeIndex": 6 |}propName|]: string;|] // r3
|
2015-12-23 05:26:54 +01:00
|
|
|
|
//// }
|
|
|
|
|
//// class class2 extends class1 implements interface1 {
|
2019-06-13 21:25:02 +02:00
|
|
|
|
//// [|[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 8 |}doStuff|]() { }|] // r4
|
|
|
|
|
//// [|[|{| "isDefinition": true, "contextRangeIndex": 10 |}propName|]: string;|] // r5
|
2015-12-23 05:26:54 +01:00
|
|
|
|
//// }
|
2017-01-27 17:59:33 +01:00
|
|
|
|
////
|
2015-12-23 05:26:54 +01:00
|
|
|
|
//// var v: class2;
|
2017-01-27 17:59:33 +01:00
|
|
|
|
//// v.[|doStuff|](); // r6
|
|
|
|
|
//// v.[|propName|]; // r7
|
2015-12-23 05:26:54 +01:00
|
|
|
|
|
2019-06-06 00:01:34 +02:00
|
|
|
|
const [r0Def, r0, r1Def, r1, r2Def, r2, r3Def, r3, r4Def, r4, r5Def, r5, r6, r7] = test.ranges();
|
2018-03-19 19:58:20 +01:00
|
|
|
|
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] },
|
|
|
|
|
]);
|
2018-01-04 19:58:14 +01:00
|
|
|
|
verify.referenceGroups([r4, r6], [
|
2017-01-27 17:59:33 +01:00
|
|
|
|
{ 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] }
|
|
|
|
|
]);
|