File: findAllRefsReExportStarAs.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 (20 lines) | stat: -rw-r--r-- 1,185 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/// <reference path="fourslash.ts" />

// @Filename: /leafModule.ts
////[|{| "id": "helloDecl" |}export const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "helloDecl" |}hello|] = () => 'Hello';|]

// @Filename: /exporting.ts
////[|{| "id": "leafExportDecl" |}export * as [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "leafExportDecl" |}Leaf|] from './leafModule';|]

// @Filename: /importing.ts
//// [|{| "id": "leafImportDecl" |}import { [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeId": "leafImportDecl" |}Leaf|] } from './exporting';|]
//// [|Leaf|].[|hello|]()

verify.noErrors();
const ranges = test.ranges();
const [helloDecl, helloDef, leafExportDecl, leafDef, leafImportDecl, leafImportDef, leafUse, helloUse] = ranges;
verify.singleReferenceGroup("const hello: () => string", [helloDef, helloUse]);
const leafExportAsRef = { definition: "import Leaf", ranges: [leafDef] };
const leafImportRef = { definition: "import Leaf", ranges: [leafImportDef, leafUse] };
verify.referenceGroups([leafDef], [leafExportAsRef, leafImportRef]);
verify.referenceGroups([leafImportDef, leafUse], [leafImportRef, leafExportAsRef]);