@@ -887,7 +887,7 @@ function addCompletionEntriesFromPathsOrExports(
887
887
if ( typeof pathPattern === "string" || matchedPath === undefined || comparePaths ( key , matchedPath ) !== Comparison . GreaterThan ) {
888
888
pathResults . push ( {
889
889
matchedPattern : isMatch ,
890
- results : getCompletionsForPathMapping ( keyWithoutLeadingDotSlash , patterns , fragment , baseDirectory , extensionOptions , ( isExports || isImports ) && endsWith ( keyWithoutLeadingDotSlash , '*' ) , isImports , compilerOptions , host , moduleSpecifierResolutionHost )
890
+ results : getCompletionsForPathMapping ( keyWithoutLeadingDotSlash , patterns , fragment , baseDirectory , extensionOptions , ( isExports || isImports ) && endsWith ( keyWithoutLeadingDotSlash , "*" ) , isImports , compilerOptions , host , moduleSpecifierResolutionHost )
891
891
. map ( ( { name, kind, extension } ) => nameAndKind ( name , kind , extension ) ) ,
892
892
} ) ;
893
893
}
@@ -1096,9 +1096,9 @@ function getCompletionsForPathMapping(
1096
1096
isImports : boolean ,
1097
1097
compilerOptions : CompilerOptions ,
1098
1098
host : LanguageServiceHost ,
1099
- moduleSpecifierResolutionHost : ModuleSpecifierResolutionHost | undefined
1099
+ moduleSpecifierResolutionHost : ModuleSpecifierResolutionHost | undefined ,
1100
1100
) : readonly NameAndKind [ ] {
1101
- const parsedPath = tryParsePattern ( path )
1101
+ const parsedPath = tryParsePattern ( path ) ;
1102
1102
if ( ! parsedPath ) {
1103
1103
return emptyArray ;
1104
1104
}
@@ -1109,7 +1109,7 @@ function getCompletionsForPathMapping(
1109
1109
}
1110
1110
const remainingFragment = tryRemovePrefix ( fragment , parsedPath . prefix ) ;
1111
1111
if ( remainingFragment === undefined ) {
1112
- const starIsFullPathComponent = endsWith ( path , '/*' ) ;
1112
+ const starIsFullPathComponent = endsWith ( path , "/*" ) ;
1113
1113
return starIsFullPathComponent ? justPathMappingName ( parsedPath . prefix , ScriptElementKind . directory ) : flatMap ( patterns , pattern => getModulesForPathsPattern ( "" , packageDirectory , pattern , extensionOptions , isExportsWildcard , isImports , compilerOptions , host , moduleSpecifierResolutionHost ) ?. map ( ( { name, ...rest } ) => ( { name : parsedPath . prefix + name + parsedPath . suffix , ...rest } ) ) ) ;
1114
1114
}
1115
1115
return flatMap ( patterns , pattern => getModulesForPathsPattern ( remainingFragment , packageDirectory , pattern , extensionOptions , isExportsWildcard , isImports , compilerOptions , host , moduleSpecifierResolutionHost ) ) ;
@@ -1128,7 +1128,7 @@ function getModulesForPathsPattern(
1128
1128
isImports : boolean ,
1129
1129
compilerOptions : CompilerOptions ,
1130
1130
host : LanguageServiceHost ,
1131
- moduleSpecifierResolutionHost : ModuleSpecifierResolutionHost | undefined
1131
+ moduleSpecifierResolutionHost : ModuleSpecifierResolutionHost | undefined ,
1132
1132
) : readonly NameAndKind [ ] | undefined {
1133
1133
if ( ! host . readDirectory ) {
1134
1134
return undefined ;
@@ -1157,7 +1157,7 @@ function getModulesForPathsPattern(
1157
1157
const matchingSuffixes = [ ...( inputExtension ? inputExtension . map ( ext => changeExtension ( normalizedSuffix , ext ) ) : [ ] ) , declarationExtension && changeExtension ( normalizedSuffix , declarationExtension ) , normalizedSuffix ] . filter ( isString ) ;
1158
1158
// Need to normalize after combining: If we combinePaths("a", "../b"), we want "b" and not "a/../b".
1159
1159
const baseDirectory = normalizePath ( combinePaths ( packageDirectory , expandedPrefixDirectory ) ) ;
1160
- const inputBaseDirectory = isImports && getPossibleOriginalInputPathWithoutChangingExt ( baseDirectory , ! hostUsesCaseSensitiveFileNames ( moduleSpecifierResolutionHost ! ) , compilerOptions . outDir , ( ) => moduleSpecifierResolutionHost ! . getCommonSourceDirectory ( ) ) ;
1160
+ const inputBaseDirectory = isImports && getPossibleOriginalInputPathWithoutChangingExt ( baseDirectory , ! hostUsesCaseSensitiveFileNames ( moduleSpecifierResolutionHost ! ) , compilerOptions . outDir , ( ) => moduleSpecifierResolutionHost ! . getCommonSourceDirectory ( ) ) ;
1161
1161
const completePrefix = fragmentHasPath ? baseDirectory : ensureTrailingDirectorySeparator ( baseDirectory ) + normalizedPrefixBase ;
1162
1162
1163
1163
// If we have a suffix, then we read the directory all the way down to avoid returning completions for
0 commit comments