Skip to content

Commit 2adb14c

Browse files
committed
format
1 parent 238651d commit 2adb14c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/services/stringCompletions.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ function addCompletionEntriesFromPathsOrExports(
887887
if (typeof pathPattern === "string" || matchedPath === undefined || comparePaths(key, matchedPath) !== Comparison.GreaterThan) {
888888
pathResults.push({
889889
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)
891891
.map(({ name, kind, extension }) => nameAndKind(name, kind, extension)),
892892
});
893893
}
@@ -1096,9 +1096,9 @@ function getCompletionsForPathMapping(
10961096
isImports: boolean,
10971097
compilerOptions: CompilerOptions,
10981098
host: LanguageServiceHost,
1099-
moduleSpecifierResolutionHost: ModuleSpecifierResolutionHost | undefined
1099+
moduleSpecifierResolutionHost: ModuleSpecifierResolutionHost | undefined,
11001100
): readonly NameAndKind[] {
1101-
const parsedPath = tryParsePattern(path)
1101+
const parsedPath = tryParsePattern(path);
11021102
if (!parsedPath) {
11031103
return emptyArray;
11041104
}
@@ -1109,7 +1109,7 @@ function getCompletionsForPathMapping(
11091109
}
11101110
const remainingFragment = tryRemovePrefix(fragment, parsedPath.prefix);
11111111
if (remainingFragment === undefined) {
1112-
const starIsFullPathComponent = endsWith(path, '/*');
1112+
const starIsFullPathComponent = endsWith(path, "/*");
11131113
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 })));
11141114
}
11151115
return flatMap(patterns, pattern => getModulesForPathsPattern(remainingFragment, packageDirectory, pattern, extensionOptions, isExportsWildcard, isImports, compilerOptions, host, moduleSpecifierResolutionHost));
@@ -1128,7 +1128,7 @@ function getModulesForPathsPattern(
11281128
isImports: boolean,
11291129
compilerOptions: CompilerOptions,
11301130
host: LanguageServiceHost,
1131-
moduleSpecifierResolutionHost: ModuleSpecifierResolutionHost | undefined
1131+
moduleSpecifierResolutionHost: ModuleSpecifierResolutionHost | undefined,
11321132
): readonly NameAndKind[] | undefined {
11331133
if (!host.readDirectory) {
11341134
return undefined;
@@ -1157,7 +1157,7 @@ function getModulesForPathsPattern(
11571157
const matchingSuffixes = [...(inputExtension ? inputExtension.map(ext => changeExtension(normalizedSuffix, ext)) : []), declarationExtension && changeExtension(normalizedSuffix, declarationExtension), normalizedSuffix].filter(isString);
11581158
// Need to normalize after combining: If we combinePaths("a", "../b"), we want "b" and not "a/../b".
11591159
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());
11611161
const completePrefix = fragmentHasPath ? baseDirectory : ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase;
11621162

11631163
// If we have a suffix, then we read the directory all the way down to avoid returning completions for

0 commit comments

Comments
 (0)