• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/// <reference path='fourslash.ts' />
2
3// @noLib: true
4
5// @Filename: /a.ts
6////[|var /*ax0*/[|{| "isDefinition": true, "contextRangeIndex": 0 |}x|];|]
7////[|export { /*ax1*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}x|] };|]
8////[|export { /*ax2*/[|{| "contextRangeIndex": 4 |}x|] as /*ay*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}y|] };|]
9
10// @Filename: /b.ts
11////[|import { /*bx0*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 7 |}x|], /*by0*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 7 |}y|] } from "./a";|]
12/////*bx1*/[|x|]; /*by1*/[|y|];
13
14verify.noErrors();
15
16const [ax0Def, ax0, ax1Def, ax1, ax2Def, ax2, ay, bx0Def, bx0, by0, bx1, by1] = test.ranges();
17const bxRanges = [bx0, bx1];
18const byRanges = [by0, by1];
19
20verify.baselineFindAllReferences('ax0', 'ax1', 'ax2', 'bx0', 'bx1', 'ay', 'by0', 'by1')
21
22verify.renameLocations([ax0, ax2], [ax0, { range: ax1, suffixText: " as x" }, ax2]);
23verify.renameLocations(ax1, [{ range: ax1, prefixText: "x as " }, bx0, bx1]);
24verify.renameLocations(bxRanges, [{ range: bx0, prefixText: "x as " }, bx1]);
25verify.renameLocations(ay, [ay, ...byRanges]);
26verify.renameLocations(byRanges, [{ range: by0, prefixText: "y as " }, by1]);
27