File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -443,6 +443,7 @@ namespace ts.codefix {
443
443
return undefined ;
444
444
}
445
445
446
+ const relativeNameWithIndex = removeFileExtension ( relativeName ) ;
446
447
relativeName = removeExtensionAndIndexPostFix ( relativeName ) ;
447
448
448
449
if ( options . paths ) {
@@ -462,7 +463,7 @@ namespace ts.codefix {
462
463
return key . replace ( "\*" , matchedStar ) ;
463
464
}
464
465
}
465
- else if ( pattern === relativeName ) {
466
+ else if ( pattern === relativeName || pattern === relativeNameWithIndex ) {
466
467
return key ;
467
468
}
468
469
}
Original file line number Diff line number Diff line change
1
+ /// <reference path="fourslash.ts" />
2
+
3
+ //// [|foo/*0*/();|]
4
+
5
+ // @Filename : folder_b/index.ts
6
+ //// export function foo() {};
7
+
8
+ // @Filename : tsconfig.path.json
9
+ //// {
10
+ //// "compilerOptions": {
11
+ //// "baseUrl": ".",
12
+ //// "paths": {
13
+ //// "b": [ "folder_b/index" ]
14
+ //// }
15
+ //// }
16
+ //// }
17
+
18
+ // @Filename : tsconfig.json
19
+ //// {
20
+ //// "extends": "./tsconfig.path",
21
+ //// "compilerOptions": { }
22
+ //// }
23
+
24
+ verify . importFixAtPosition ( [
25
+ `import { foo } from "b";
26
+
27
+ foo();`
28
+ ] ) ;
You can’t perform that action at this time.
0 commit comments