Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'main' into optimizeOpenProjects
  • Loading branch information
sheetalkamat committed Sep 18, 2024
commit 0bb105f9c79fe77f5162edd30b870bdad8d13df4
8 changes: 4 additions & 4 deletions src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3251,13 +3251,13 @@ function shouldReportNoInputFiles(fileNames: string[], canJsonReportNoInutFiles:
}

/** @internal */
export function isSolutionConfig(config: ParsedCommandLine) {
export function isSolutionConfig(config: ParsedCommandLine): boolean {
return !config.fileNames.length &&
hasProperty(config.raw, "references");
}

/** @internal */
export function canJsonReportNoInputFiles(raw: any) {
export function canJsonReportNoInputFiles(raw: any): boolean {
return !hasProperty(raw, "files") && !hasProperty(raw, "references");
}

Expand All @@ -3268,7 +3268,7 @@ export function updateErrorForNoInputFiles(
configFileSpecs: ConfigFileSpecs,
configParseDiagnostics: Diagnostic[],
canJsonReportNoInutFiles: boolean,
) {
): boolean {
const existingErrors = configParseDiagnostics.length;
if (shouldReportNoInputFiles(fileNames, canJsonReportNoInutFiles)) {
configParseDiagnostics.push(getErrorForNoInputFiles(configFileSpecs, configFileName));
Expand Down Expand Up @@ -3979,7 +3979,7 @@ export function matchesExcludeWorker(
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;
Expand Down
15 changes: 8 additions & 7 deletions src/server/editorServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,8 @@ export type ConfiguredProjectToAnyReloadKind = Map<
| ConfiguredProjectLoadKind.ReloadOptimized
>;

type DefaultConfiguredProjectResult = ReturnType<ProjectService["tryFindDefaultConfiguredProjectForOpenScriptInfoOrClosedFileInfo"]>;
/** @internal */
export type DefaultConfiguredProjectResult = ReturnType<ProjectService["tryFindDefaultConfiguredProjectForOpenScriptInfoOrClosedFileInfo"]>;

/** @internal */
export interface FindCreateOrLoadConfiguredProjectResult {
Expand Down Expand Up @@ -2630,7 +2631,7 @@ export class ProjectService {
}

/** @internal */
findDefaultConfiguredProject(info: ScriptInfo) {
findDefaultConfiguredProject(info: ScriptInfo): ConfiguredProject | undefined {
return this.findDefaultConfiguredProjectWorker(
info,
ConfiguredProjectLoadKind.Find,
Expand All @@ -2641,7 +2642,7 @@ export class ProjectService {
findDefaultConfiguredProjectWorker(
info: ScriptInfo,
kind: ConfiguredProjectLoadKind.Find | ConfiguredProjectLoadKind.CreateReplay,
) {
): DefaultConfiguredProjectResult | undefined {
return info.isScriptOpen() ?
this.tryFindDefaultConfiguredProjectForOpenScriptInfo(
info,
Expand Down Expand Up @@ -3183,7 +3184,7 @@ export class ProjectService {
*
* @internal
*/
reloadFileNamesOfConfiguredProject(project: ConfiguredProject) {
reloadFileNamesOfConfiguredProject(project: ConfiguredProject): boolean {
const config = this.reloadFileNamesOfParsedConfig(project.getConfigFilePath(), this.configFileExistenceInfoCache.get(project.canonicalConfigFilePath)!.config!);
project.updateErrorOnNoInputFiles(config);
this.updateNonInferredProjectFiles(
Expand Down Expand Up @@ -3224,7 +3225,7 @@ export class ProjectService {
project: ConfiguredProject,
reason: string,
reloadedProjects: ConfiguredProjectToAnyReloadKind,
) {
): void {
if (reloadedProjects.has(project)) return;
reloadedProjects.set(project, ConfiguredProjectLoadKind.ReloadOptimized);
if (!project.initialLoadPending) {
Expand All @@ -3237,7 +3238,7 @@ export class ProjectService {
project: ConfiguredProject,
reason: string,
reloadedProjects: ConfiguredProjectToAnyReloadKind,
) {
): boolean {
if (reloadedProjects.get(project) === ConfiguredProjectLoadKind.Reload) return false;
reloadedProjects.set(project, ConfiguredProjectLoadKind.Reload);
this.clearSemanticCache(project);
Expand Down Expand Up @@ -3269,7 +3270,7 @@ export class ProjectService {
*
* @internal
*/
reloadConfiguredProject(project: ConfiguredProject, reason: string) {
reloadConfiguredProject(project: ConfiguredProject, reason: string): void {
project.initialLoadPending = false;
this.setProjectForReload(project, ProgramUpdateLevel.Update);
// Load project from the disk
Expand Down
8 changes: 4 additions & 4 deletions src/server/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2945,7 +2945,7 @@ export class ConfiguredProject extends Project {
}

/** @internal */
override getParsedCommandLine(fileName: string) {
override getParsedCommandLine(fileName: string): ParsedCommandLine | undefined {
const configFileName = toNormalizedPath(fileName);
const canonicalConfigFilePath = asNormalizedPath(this.projectService.toCanonicalFileName(configFileName));
// Ensure the config file existience info is cached
Expand All @@ -2963,7 +2963,7 @@ export class ConfiguredProject extends Project {
}

/** @internal */
onReleaseParsedCommandLine(fileName: string) {
onReleaseParsedCommandLine(fileName: string): void {
this.releaseParsedConfig(asNormalizedPath(this.projectService.toCanonicalFileName(toNormalizedPath(fileName))));
}

Expand Down Expand Up @@ -3038,7 +3038,7 @@ export class ConfiguredProject extends Project {
}

/** @internal */
setPotentialProjectReference(canonicalConfigPath: NormalizedPath) {
setPotentialProjectReference(canonicalConfigPath: NormalizedPath): void {
Debug.assert(this.initialLoadPending);
(this.potentialProjectReferences || (this.potentialProjectReferences = new Set())).add(canonicalConfigPath);
}
Expand Down Expand Up @@ -3125,7 +3125,7 @@ export class ConfiguredProject extends Project {
}

/** @internal */
updateErrorOnNoInputFiles(parsedCommandLine: ParsedCommandLine) {
updateErrorOnNoInputFiles(parsedCommandLine: ParsedCommandLine): void {
this.parsedCommandLine = parsedCommandLine;
updateErrorForNoInputFiles(
parsedCommandLine.fileNames,
Expand Down
4 changes: 2 additions & 2 deletions src/server/scriptInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -740,15 +740,15 @@ function failIfInvalidLocation(location: protocol.Location) {
}

/** @internal */
export function scriptInfoIsContainedByBackgroundProject(info: ScriptInfo) {
export function scriptInfoIsContainedByBackgroundProject(info: ScriptInfo): boolean {
return some(
info.containingProjects,
isBackgroundProject,
);
}

/** @internal */
export function scriptInfoIsContainedByDeferredClosedProject(info: ScriptInfo) {
export function scriptInfoIsContainedByDeferredClosedProject(info: ScriptInfo): boolean {
return some(
info.containingProjects,
isProjectDeferredClose,
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy