2017-01-26 20:02:08 +01:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
// @noLib: true
|
|
|
|
|
|
|
|
// @Filename: /a.ts
|
2019-06-13 21:25:02 +02:00
|
|
|
////[|var [|{| "isDefinition": true, "contextRangeIndex": 0 |}x|];|]
|
|
|
|
////[|export { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}x|] };|]
|
|
|
|
////[|export { [|{| "contextRangeIndex": 4 |}x|] as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}y|] };|]
|
2017-01-26 20:02:08 +01:00
|
|
|
|
|
|
|
// @Filename: /b.ts
|
2019-06-13 21:25:02 +02:00
|
|
|
////[|import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 7 |}x|], [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 7 |}y|] } from "./a";|]
|
2017-01-26 20:02:08 +01:00
|
|
|
////[|x|]; [|y|];
|
|
|
|
|
|
|
|
verify.noErrors();
|
|
|
|
|
2019-06-05 21:38:15 +02:00
|
|
|
const [ax0Def, ax0, ax1Def, ax1, ax2Def, ax2, ay, bx0Def, bx0, by0, bx1, by1] = test.ranges();
|
2017-01-26 20:02:08 +01:00
|
|
|
const axRanges = [ax0, ax1, ax2];
|
|
|
|
const bxRanges = [bx0, bx1];
|
|
|
|
const byRanges = [by0, by1];
|
|
|
|
const axGroup = { definition: "var x: any", ranges: axRanges };
|
2017-10-26 02:50:11 +02:00
|
|
|
const bxGroup = { definition: "(alias) var x: any\nimport x", ranges: bxRanges };
|
2018-04-23 22:29:14 +02:00
|
|
|
const ayGroup = { definition: "(alias) var y: any\nexport y", ranges: [ay] }
|
2017-10-26 02:50:11 +02:00
|
|
|
const byGroup = { definition: "(alias) var y: any\nimport y", ranges: byRanges }
|
2017-01-26 20:02:08 +01:00
|
|
|
|
|
|
|
verify.referenceGroups(axRanges, [axGroup, bxGroup, ayGroup, byGroup]);
|
|
|
|
verify.referenceGroups(bxRanges, [bxGroup, axGroup, ayGroup, byGroup]);
|
|
|
|
verify.referenceGroups(ay, [ayGroup, byGroup]);
|
|
|
|
verify.referenceGroups(byRanges, [byGroup, ayGroup]);
|
|
|
|
|
2018-11-14 18:09:00 +01:00
|
|
|
verify.renameLocations([ax0, ax2], [ax0, { range: ax1, suffixText: " as x" }, ax2]);
|
|
|
|
verify.renameLocations(ax1, [{ range: ax1, prefixText: "x as " }, bx0, bx1]);
|
|
|
|
verify.renameLocations(bxRanges, [{ range: bx0, prefixText: "x as " }, bx1]);
|
|
|
|
verify.renameLocations(ay, [ay, ...byRanges]);
|
|
|
|
verify.renameLocations(byRanges, [{ range: by0, prefixText: "y as " }, by1]);
|