Dont open composite projects to determine if script info is part of project (#59688)

This commit is contained in:
Sheetal Nandi
2024-09-18 10:35:22 -07:00
committed by GitHub
parent 8230bc66a7
commit 02b07a1788
1079 changed files with 31109 additions and 25547 deletions
+16 -3
View File
@@ -3250,13 +3250,25 @@ function shouldReportNoInputFiles(fileNames: string[], canJsonReportNoInutFiles:
return fileNames.length === 0 && canJsonReportNoInutFiles && (!resolutionStack || resolutionStack.length === 0);
}
/** @internal */
export function isSolutionConfig(config: ParsedCommandLine): boolean {
return !config.fileNames.length &&
hasProperty(config.raw, "references");
}
/** @internal */
export function canJsonReportNoInputFiles(raw: any): boolean {
return !hasProperty(raw, "files") && !hasProperty(raw, "references");
}
/** @internal */
export function updateErrorForNoInputFiles(fileNames: string[], configFileName: string, configFileSpecs: ConfigFileSpecs, configParseDiagnostics: Diagnostic[], canJsonReportNoInutFiles: boolean): boolean {
export function updateErrorForNoInputFiles(
fileNames: string[],
configFileName: string,
configFileSpecs: ConfigFileSpecs,
configParseDiagnostics: Diagnostic[],
canJsonReportNoInutFiles: boolean,
): boolean {
const existingErrors = configParseDiagnostics.length;
if (shouldReportNoInputFiles(fileNames, canJsonReportNoInutFiles)) {
configParseDiagnostics.push(getErrorForNoInputFiles(configFileSpecs, configFileName));
@@ -3960,13 +3972,14 @@ export function matchesExclude(
);
}
function matchesExcludeWorker(
/** @internal */
export function matchesExcludeWorker(
pathToCheck: string,
excludeSpecs: readonly string[] | undefined,
useCaseSensitiveFileNames: boolean,
currentDirectory: string,
basePath?: string,
) {
): boolean {
const excludePattern = getRegularExpressionForWildcard(excludeSpecs, combinePaths(normalizePath(currentDirectory), basePath), "exclude");
const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames);
if (!excludeRegex) return false;