typescript 5.5.0-dev.20240509 → 5.5.0-dev.20240511

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.
@@ -20,10 +20,18 @@ declare namespace ts {
20
20
  export import ClassificationType = ts.ClassificationType;
21
21
  export import CompletionsTriggerCharacter = ts.CompletionsTriggerCharacter;
22
22
  export import CompletionTriggerKind = ts.CompletionTriggerKind;
23
+ export import InlayHintKind = ts.InlayHintKind;
23
24
  export import OrganizeImportsMode = ts.OrganizeImportsMode;
25
+ export import RefactorActionInfo = ts.RefactorActionInfo;
24
26
  export import RefactorTriggerReason = ts.RefactorTriggerReason;
25
27
  export import RenameInfoFailure = ts.RenameInfoFailure;
26
28
  export import SemicolonPreference = ts.SemicolonPreference;
29
+ export import SignatureHelpCharacterTypedReason = ts.SignatureHelpCharacterTypedReason;
30
+ export import SignatureHelpInvokedReason = ts.SignatureHelpInvokedReason;
31
+ export import SignatureHelpParameter = ts.SignatureHelpParameter;
32
+ export import SignatureHelpRetriggerCharacter = ts.SignatureHelpRetriggerCharacter;
33
+ export import SignatureHelpRetriggeredReason = ts.SignatureHelpRetriggeredReason;
34
+ export import SignatureHelpTriggerCharacter = ts.SignatureHelpTriggerCharacter;
27
35
  export import SignatureHelpTriggerReason = ts.SignatureHelpTriggerReason;
28
36
  export import SymbolDisplayPart = ts.SymbolDisplayPart;
29
37
  export import UserPreferences = ts.UserPreferences;
@@ -2900,8 +2908,6 @@ declare namespace ts {
2900
2908
  */
2901
2909
  class ConfiguredProject extends Project {
2902
2910
  readonly canonicalConfigFilePath: NormalizedPath;
2903
- /** Ref count to the project when opened from external project */
2904
- private externalProjectRefCount;
2905
2911
  private projectReferences;
2906
2912
  /**
2907
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
@@ -3145,6 +3151,10 @@ declare namespace ts {
3145
3151
  * Open files: with value being project root path, and key being Path of the file that is open
3146
3152
  */
3147
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;
3148
3158
  /**
3149
3159
  * Map of open files that are opened without complete path but have projectRoot as current directory
3150
3160
  */
@@ -3163,6 +3173,11 @@ declare namespace ts {
3163
3173
  private safelist;
3164
3174
  private readonly legacySafelist;
3165
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?;
3166
3181
  readonly currentDirectory: NormalizedPath;
3167
3182
  readonly toCanonicalFileName: (f: string) => string;
3168
3183
  readonly host: ServerHost;
@@ -3194,6 +3209,11 @@ declare namespace ts {
3194
3209
  setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.InferredProjectCompilerOptions, projectRootPath?: string): void;
3195
3210
  findProject(projectName: string): Project | undefined;
3196
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;
3197
3217
  private doEnsureDefaultProjectForFile;
3198
3218
  getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName: string): ScriptInfo | undefined;
3199
3219
  /**
@@ -3213,13 +3233,6 @@ declare namespace ts {
3213
3233
  private delayUpdateSourceInfoProjects;
3214
3234
  private delayUpdateProjectsOfScriptInfoPath;
3215
3235
  private handleDeletedFile;
3216
- /**
3217
- * This function goes through all the openFiles and tries to file the config file for them.
3218
- * If the config file is found and it refers to existing project, it schedules the reload it for reload
3219
- * If there is no existing project it just opens the configured project for the config file
3220
- * shouldReloadProjectFor provides a way to filter out files to reload configured project for
3221
- */
3222
- private delayReloadConfiguredProjectsForFile;
3223
3236
  private removeProject;
3224
3237
  private assignOrphanScriptInfosToInferredProject;
3225
3238
  /**
@@ -3229,14 +3242,6 @@ declare namespace ts {
3229
3242
  private closeOpenFile;
3230
3243
  private deleteScriptInfo;
3231
3244
  private configFileExists;
3232
- /**
3233
- * Returns true if the configFileExistenceInfo is needed/impacted by open files that are root of inferred project
3234
- */
3235
- private configFileExistenceImpactsRootOfInferredProject;
3236
- /**
3237
- * This is called on file close, so that we stop watching the config file for this script info
3238
- */
3239
- private stopWatchingConfigFilesForClosedScriptInfo;
3240
3245
  /**
3241
3246
  * This function tries to search for a tsconfig.json for the given file.
3242
3247
  * This is different from the method the compiler uses because
@@ -3246,17 +3251,10 @@ declare namespace ts {
3246
3251
  * the newly opened file.
3247
3252
  */
3248
3253
  private forEachConfigFileLocation;
3249
- /**
3250
- * This function tries to search for a tsconfig.json for the given file.
3251
- * This is different from the method the compiler uses because
3252
- * the compiler can assume it will always start searching in the
3253
- * current directory (the directory in which tsc was invoked).
3254
- * The server must start searching from the directory containing
3255
- * the newly opened file.
3256
- * If script info is passed in, it is asserted to be open script info
3257
- * otherwise just file name
3258
- */
3259
- 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;
3260
3258
  private printProjects;
3261
3259
  private getConfiguredProjectByCanonicalConfigFilePath;
3262
3260
  private findExternalProjectByProjectName;
@@ -3297,12 +3295,6 @@ declare namespace ts {
3297
3295
  * This does not reload contents of open files from disk. But we could do that if needed
3298
3296
  */
3299
3297
  reloadProjects(): void;
3300
- /**
3301
- * This function goes through all the openFiles and tries to file the config file for them.
3302
- * If the config file is found and it refers to existing project, it reloads it either immediately
3303
- * If there is no existing project it just opens the configured project for the config file
3304
- */
3305
- private reloadConfiguredProjectForFiles;
3306
3298
  /**
3307
3299
  * Remove the root of inferred project if script info is part of another project
3308
3300
  */
@@ -3324,11 +3316,21 @@ declare namespace ts {
3324
3316
  private findExternalProjectContainingOpenScriptInfo;
3325
3317
  private getOrCreateOpenScriptInfo;
3326
3318
  private assignProjectToOpenedScriptInfo;
3327
- 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;
3328
3330
  private ensureProjectChildren;
3329
- private cleanupAfterOpeningFile;
3331
+ private cleanupConfiguredProjects;
3332
+ private cleanupProjectsAndScriptInfos;
3330
3333
  openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult;
3331
- private removeOrphanConfiguredProjects;
3332
3334
  private removeOrphanScriptInfos;
3333
3335
  private telemetryOnOpenFile;
3334
3336
  /**
@@ -3337,7 +3339,6 @@ declare namespace ts {
3337
3339
  */
3338
3340
  closeClientFile(uncheckedFileName: string): void;
3339
3341
  private collectChanges;
3340
- private closeConfiguredProjectReferencedFromExternalProject;
3341
3342
  closeExternalProject(uncheckedFileName: string): void;
3342
3343
  openExternalProjects(projects: protocol.ExternalProject[]): void;
3343
3344
  /** Makes a filename safe to insert in a RegExp */