File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -420,10 +420,10 @@ namespace ts.codefix {
420
420
const options = context . program . getCompilerOptions ( ) ;
421
421
422
422
return tryGetModuleNameFromAmbientModule ( ) ||
423
- tryGetModuleNameFromBaseUrl ( ) ||
424
- tryGetModuleNameFromRootDirs ( ) ||
425
423
tryGetModuleNameFromTypeRoots ( ) ||
426
424
tryGetModuleNameAsNodeModule ( ) ||
425
+ tryGetModuleNameFromBaseUrl ( ) ||
426
+ tryGetModuleNameFromRootDirs ( ) ||
427
427
removeFileExtension ( getRelativePath ( moduleFileName , sourceDirectory ) ) ;
428
428
429
429
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