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 {
443443 return undefined ;
444444 }
445445
446+ const relativeNameWithIndex = removeFileExtension ( relativeName ) ;
446447 relativeName = removeExtensionAndIndexPostFix ( relativeName ) ;
447448
448449 if ( options . paths ) {
@@ -462,7 +463,7 @@ namespace ts.codefix {
462463 return key . replace ( "\*" , matchedStar ) ;
463464 }
464465 }
465- else if ( pattern === relativeName ) {
466+ else if ( pattern === relativeName || pattern === relativeNameWithIndex ) {
466467 return key ;
467468 }
468469 }
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