@typescript-deploys/pr-build 5.5.0-pr-58495-9 → 5.5.0-pr-58525-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2908,8 +2908,6 @@ declare namespace ts {
2908
2908
  */
2909
2909
  class ConfiguredProject extends Project {
2910
2910
  readonly canonicalConfigFilePath: NormalizedPath;
2911
- /** Ref count to the project when opened from external project */
2912
- private externalProjectRefCount;
2913
2911
  private projectReferences;
2914
2912
  /**
2915
2913
  * If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph
@@ -3153,6 +3151,10 @@ declare namespace ts {
3153
3151
  * Open files: with value being project root path, and key being Path of the file that is open
3154
3152
  */
3155
3153
  readonly openFiles: Map<Path, NormalizedPath | undefined>;
3154
+ /** Config files looked up and cached config files for open script info */
3155
+ private readonly configFileForOpenFiles;
3156
+ /** Set of open script infos that are root of inferred project */
3157
+ private rootOfInferredProjects;
3156
3158
  /**
3157
3159
  * Map of open files that are opened without complete path but have projectRoot as current directory
3158
3160
  */
@@ -3171,6 +3173,11 @@ declare namespace ts {
3171
3173
  private safelist;
3172
3174
  private readonly legacySafelist;
3173
3175
  private pendingProjectUpdates;
3176
+ /**
3177
+ * All the open script info that needs recalculation of the default project,
3178
+ * this also caches config file info before config file change was detected to use it in case projects are not updated yet
3179
+ */
3180
+ private pendingOpenFileProjectUpdates?;
3174
3181
  readonly currentDirectory: NormalizedPath;
3175
3182
  readonly toCanonicalFileName: (f: string) => string;
3176
3183
  readonly host: ServerHost;
@@ -3202,6 +3209,11 @@ declare namespace ts {
3202
3209
  setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.InferredProjectCompilerOptions, projectRootPath?: string): void;
3203
3210
  findProject(projectName: string): Project | undefined;
3204
3211
  getDefaultProjectForFile(fileName: NormalizedPath, ensureProject: boolean): Project | undefined;
3212
+ /**
3213
+ * If there is default project calculation pending for this file,
3214
+ * then it completes that calculation so that correct default project is used for the project
3215
+ */
3216
+ private tryGetDefaultProjectForEnsuringConfiguredProjectForFile;
3205
3217
  private doEnsureDefaultProjectForFile;
3206
3218
  getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName: string): ScriptInfo | undefined;
3207
3219
  /**
@@ -3221,13 +3233,6 @@ declare namespace ts {
3221
3233
  private delayUpdateSourceInfoProjects;
3222
3234
  private delayUpdateProjectsOfScriptInfoPath;
3223
3235
  private handleDeletedFile;
3224
- /**
3225
- * This function goes through all the openFiles and tries to file the config file for them.
3226
- * If the config file is found and it refers to existing project, it schedules the reload it for reload
3227
- * If there is no existing project it just opens the configured project for the config file
3228
- * shouldReloadProjectFor provides a way to filter out files to reload configured project for
3229
- */
3230
- private delayReloadConfiguredProjectsForFile;
3231
3236
  private removeProject;
3232
3237
  private assignOrphanScriptInfosToInferredProject;
3233
3238
  /**
@@ -3237,14 +3242,6 @@ declare namespace ts {
3237
3242
  private closeOpenFile;
3238
3243
  private deleteScriptInfo;
3239
3244
  private configFileExists;
3240
- /**
3241
- * Returns true if the configFileExistenceInfo is needed/impacted by open files that are root of inferred project
3242
- */
3243
- private configFileExistenceImpactsRootOfInferredProject;
3244
- /**
3245
- * This is called on file close, so that we stop watching the config file for this script info
3246
- */
3247
- private stopWatchingConfigFilesForClosedScriptInfo;
3248
3245
  /**
3249
3246
  * This function tries to search for a tsconfig.json for the given file.
3250
3247
  * This is different from the method the compiler uses because
@@ -3254,17 +3251,10 @@ declare namespace ts {
3254
3251
  * the newly opened file.
3255
3252
  */
3256
3253
  private forEachConfigFileLocation;
3257
- /**
3258
- * This function tries to search for a tsconfig.json for the given file.
3259
- * This is different from the method the compiler uses because
3260
- * the compiler can assume it will always start searching in the
3261
- * current directory (the directory in which tsc was invoked).
3262
- * The server must start searching from the directory containing
3263
- * the newly opened file.
3264
- * If script info is passed in, it is asserted to be open script info
3265
- * otherwise just file name
3266
- */
3267
- private getConfigFileNameForFile;
3254
+ /** Get cached configFileName for scriptInfo or ancestor of open script info */
3255
+ private getConfigFileNameForFileFromCache;
3256
+ /** Caches the configFilename for script info or ancestor of open script info */
3257
+ private setConfigFileNameForFileInCache;
3268
3258
  private printProjects;
3269
3259
  private getConfiguredProjectByCanonicalConfigFilePath;
3270
3260
  private findExternalProjectByProjectName;
@@ -3305,12 +3295,6 @@ declare namespace ts {
3305
3295
  * This does not reload contents of open files from disk. But we could do that if needed
3306
3296
  */
3307
3297
  reloadProjects(): void;
3308
- /**
3309
- * This function goes through all the openFiles and tries to file the config file for them.
3310
- * If the config file is found and it refers to existing project, it reloads it either immediately
3311
- * If there is no existing project it just opens the configured project for the config file
3312
- */
3313
- private reloadConfiguredProjectForFiles;
3314
3298
  /**
3315
3299
  * Remove the root of inferred project if script info is part of another project
3316
3300
  */
@@ -3332,11 +3316,21 @@ declare namespace ts {
3332
3316
  private findExternalProjectContainingOpenScriptInfo;
3333
3317
  private getOrCreateOpenScriptInfo;
3334
3318
  private assignProjectToOpenedScriptInfo;
3335
- private createAncestorProjects;
3319
+ /**
3320
+ * Finds the default configured project for given info
3321
+ * For any tsconfig found, it looks into that project, if not then all its references,
3322
+ * The search happens for all tsconfigs till projectRootPath
3323
+ */
3324
+ private tryFindDefaultConfiguredProjectForOpenScriptInfo;
3325
+ /**
3326
+ * Finds the default configured project, if found, it creates the solution projects (does not load them right away)
3327
+ * with Find: finds the projects even if the project is deferredClosed
3328
+ */
3329
+ private tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo;
3336
3330
  private ensureProjectChildren;
3337
- private cleanupAfterOpeningFile;
3331
+ private cleanupConfiguredProjects;
3332
+ private cleanupProjectsAndScriptInfos;
3338
3333
  openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult;
3339
- private removeOrphanConfiguredProjects;
3340
3334
  private removeOrphanScriptInfos;
3341
3335
  private telemetryOnOpenFile;
3342
3336
  /**
@@ -3345,7 +3339,6 @@ declare namespace ts {
3345
3339
  */
3346
3340
  closeClientFile(uncheckedFileName: string): void;
3347
3341
  private collectChanges;
3348
- private closeConfiguredProjectReferencedFromExternalProject;
3349
3342
  closeExternalProject(uncheckedFileName: string): void;
3350
3343
  openExternalProjects(projects: protocol.ExternalProject[]): void;
3351
3344
  /** Makes a filename safe to insert in a RegExp */