File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -420,10 +420,10 @@ namespace ts.codefix {
420420 const options = context . program . getCompilerOptions ( ) ;
421421
422422 return tryGetModuleNameFromAmbientModule ( ) ||
423- tryGetModuleNameFromBaseUrl ( ) ||
424- tryGetModuleNameFromRootDirs ( ) ||
425423 tryGetModuleNameFromTypeRoots ( ) ||
426424 tryGetModuleNameAsNodeModule ( ) ||
425+ tryGetModuleNameFromBaseUrl ( ) ||
426+ tryGetModuleNameFromRootDirs ( ) ||
427427 removeFileExtension ( getRelativePath ( moduleFileName , sourceDirectory ) ) ;
428428
429429 function tryGetModuleNameFromAmbientModule ( ) : string {
Original file line number Diff line number Diff line change 1+ /// <reference path="fourslash.ts" />
2+
3+ // @Filename : a/f1.ts
4+ //// [|foo/*0*/();|]
5+
6+ // @Filename : types/random/index.ts
7+ //// export function foo() {};
8+
9+ // @Filename : tsconfig.json
10+ //// {
11+ //// "compilerOptions": {
12+ //// "baseUrl": ".",
13+ //// "typeRoots": [
14+ //// "./types"
15+ //// ]
16+ //// }
17+ //// }
18+
19+ verify . importFixAtPosition ( [
20+ `import { foo } from "random";
21+
22+ foo();`
23+ ] ) ;
You can’t perform that action at this time.
0 commit comments