File: findAllRefsDefaultImportThroughNamespace.ts

package info (click to toggle)
node-typescript 5.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 497,488 kB
  • sloc: javascript: 2,107,274; makefile: 6; sh: 1
file content (27 lines) | stat: -rw-r--r-- 958 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/// <reference path='fourslash.ts' />

// @Filename: /a.ts
////[|export /*0*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}default|] function /*1*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}f|]() {}|]

// @Filename: /b.ts
////export import a = require("./a");

// @Filename: /c.ts
////import { a } from "./b";
////a./*2*/[|default|]();
////
////declare const x: { [|/*3*/[|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 4 |}default|]: number|] };
////x./*4*/[|default|];

const [r0Def, r0, r1, r2, r3Def, r3, r4] = test.ranges();

// Can't rename a default import.
goTo.rangeStart(r2);
verify.renameInfoFailed();

verify.baselineCommands(
    { type: "findAllReferences", markerOrRange: ['0', '1', '2', '3', '4'] },
    { type: "findRenameLocations", markerOrRange: r1 },
    // Can rename a default property.
    { type: "findRenameLocations", markerOrRange: [r3, r4] },
);