Skip to content

Commit be2227e

Browse files
crisbetoclydin
authored andcommitted
build: update to the TypeScript 5.5 RC
Updates the repo to the release candidate of TypeScript 5.5.
1 parent dd83922 commit be2227e

File tree

6 files changed

+7973
-7548
lines changed

6 files changed

+7973
-7548
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
"tree-kill": "1.2.2",
196196
"ts-node": "^10.9.1",
197197
"tslib": "2.6.3",
198-
"typescript": "5.5.0-dev.20240603",
198+
"typescript": "5.5.1-rc",
199199
"undici": "6.18.2",
200200
"verdaccio": "5.31.1",
201201
"verdaccio-auth-memory": "^10.0.0",

packages/ngtools/webpack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
3030
"@angular/compiler": "18.1.0-next.1",
3131
"@angular/compiler-cli": "18.1.0-next.1",
32-
"typescript": "5.5.0-dev.20240603",
32+
"typescript": "5.5.1-rc",
3333
"webpack": "5.91.0"
3434
}
3535
}

packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
load("//tools:defaults.bzl", "ts_library")
22

3-
# files fetched on 2024-05-30 from
4-
# https://github.com/microsoft/TypeScript/releases/tag/v5.5-beta
3+
# files fetched on 2024-06-11 from
4+
# https://github.com/microsoft/TypeScript/releases/tag/v5.5-rc
55

66
# Commands to download:
7-
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v5.5-beta/lib/typescript.d.ts -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts
8-
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v5.5-beta/lib/typescript.js -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js
7+
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v5.5-rc/lib/typescript.d.ts -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts
8+
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v5.5-rc/lib/typescript.js -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js
99

1010
licenses(["notice"]) # Apache 2.0
1111

packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts

Lines changed: 115 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,18 @@ declare namespace ts {
2020
export import ClassificationType = ts.ClassificationType;
2121
export import CompletionsTriggerCharacter = ts.CompletionsTriggerCharacter;
2222
export import CompletionTriggerKind = ts.CompletionTriggerKind;
23+
export import InlayHintKind = ts.InlayHintKind;
2324
export import OrganizeImportsMode = ts.OrganizeImportsMode;
25+
export import RefactorActionInfo = ts.RefactorActionInfo;
2426
export import RefactorTriggerReason = ts.RefactorTriggerReason;
2527
export import RenameInfoFailure = ts.RenameInfoFailure;
2628
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;
2735
export import SignatureHelpTriggerReason = ts.SignatureHelpTriggerReason;
2836
export import SymbolDisplayPart = ts.SymbolDisplayPart;
2937
export import UserPreferences = ts.UserPreferences;
@@ -99,6 +107,7 @@ declare namespace ts {
99107
GetApplicableRefactors = "getApplicableRefactors",
100108
GetEditsForRefactor = "getEditsForRefactor",
101109
GetMoveToRefactoringFileSuggestions = "getMoveToRefactoringFileSuggestions",
110+
GetPasteEdits = "getPasteEdits",
102111
OrganizeImports = "organizeImports",
103112
GetEditsForFileRename = "getEditsForFileRename",
104113
ConfigurePlugin = "configurePlugin",
@@ -112,6 +121,7 @@ declare namespace ts {
112121
ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls",
113122
ProvideInlayHints = "provideInlayHints",
114123
WatchChange = "watchChange",
124+
MapCode = "mapCode",
115125
}
116126
/**
117127
* A TypeScript Server message
@@ -469,6 +479,33 @@ declare namespace ts {
469479
files: string[];
470480
};
471481
}
482+
/**
483+
* Request refactorings at a given position post pasting text from some other location.
484+
*/
485+
export interface GetPasteEditsRequest extends Request {
486+
command: CommandTypes.GetPasteEdits;
487+
arguments: GetPasteEditsRequestArgs;
488+
}
489+
export interface GetPasteEditsRequestArgs extends FileRequestArgs {
490+
/** The text that gets pasted in a file. */
491+
pastedText: string[];
492+
/** Locations of where the `pastedText` gets added in a file. If the length of the `pastedText` and `pastedLocations` are not the same,
493+
* then the `pastedText` is combined into one and added at all the `pastedLocations`.
494+
*/
495+
pasteLocations: TextSpan[];
496+
/** The source location of each `pastedText`. If present, the length of `spans` must be equal to the length of `pastedText`. */
497+
copiedFrom?: {
498+
file: string;
499+
spans: TextSpan[];
500+
};
501+
}
502+
export interface GetPasteEditsResponse extends Response {
503+
body: PasteEditsAction;
504+
}
505+
export interface PasteEditsAction {
506+
edits: FileCodeEdits[];
507+
fixId?: {};
508+
}
472509
export interface GetEditsForRefactorRequest extends Request {
473510
command: CommandTypes.GetEditsForRefactor;
474511
arguments: GetEditsForRefactorRequestArgs;
@@ -1733,6 +1770,33 @@ declare namespace ts {
17331770
export interface InlayHintsResponse extends Response {
17341771
body?: InlayHintItem[];
17351772
}
1773+
export interface MapCodeRequestArgs extends FileRequestArgs {
1774+
/**
1775+
* The files and changes to try and apply/map.
1776+
*/
1777+
mapping: MapCodeRequestDocumentMapping;
1778+
}
1779+
export interface MapCodeRequestDocumentMapping {
1780+
/**
1781+
* The specific code to map/insert/replace in the file.
1782+
*/
1783+
contents: string[];
1784+
/**
1785+
* Areas of "focus" to inform the code mapper with. For example, cursor
1786+
* location, current selection, viewport, etc. Nested arrays denote
1787+
* priority: toplevel arrays are more important than inner arrays, and
1788+
* inner array priorities are based on items within that array. Items
1789+
* earlier in the arrays have higher priority.
1790+
*/
1791+
focusLocations?: TextSpan[][];
1792+
}
1793+
export interface MapCodeRequest extends FileRequest {
1794+
command: CommandTypes.MapCode;
1795+
arguments: MapCodeRequestArgs;
1796+
}
1797+
export interface MapCodeResponse extends Response {
1798+
body: readonly FileCodeEdits[];
1799+
}
17361800
/**
17371801
* Synchronous request for semantic diagnostics of one file.
17381802
*/
@@ -2720,7 +2784,6 @@ declare namespace ts {
27202784
private compilerOptions;
27212785
compileOnSaveEnabled: boolean;
27222786
protected watchOptions: WatchOptions | undefined;
2723-
private rootFiles;
27242787
private rootFilesMap;
27252788
private program;
27262789
private externalFiles;
@@ -2801,7 +2864,7 @@ declare namespace ts {
28012864
private detachScriptInfoIfNotRoot;
28022865
isClosed(): boolean;
28032866
hasRoots(): boolean;
2804-
getRootFiles(): ts.server.NormalizedPath[];
2867+
getRootFiles(): NormalizedPath[];
28052868
getRootScriptInfos(): ts.server.ScriptInfo[];
28062869
getScriptInfos(): ScriptInfo[];
28072870
getExcludedFiles(): readonly NormalizedPath[];
@@ -2872,8 +2935,6 @@ declare namespace ts {
28722935
*/
28732936
class ConfiguredProject extends Project {
28742937
readonly canonicalConfigFilePath: NormalizedPath;
2875-
/** Ref count to the project when opened from external project */
2876-
private externalProjectRefCount;
28772938
private projectReferences;
28782939
/**
28792940
* If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph
@@ -3117,6 +3178,10 @@ declare namespace ts {
31173178
* Open files: with value being project root path, and key being Path of the file that is open
31183179
*/
31193180
readonly openFiles: Map<Path, NormalizedPath | undefined>;
3181+
/** Config files looked up and cached config files for open script info */
3182+
private readonly configFileForOpenFiles;
3183+
/** Set of open script infos that are root of inferred project */
3184+
private rootOfInferredProjects;
31203185
/**
31213186
* Map of open files that are opened without complete path but have projectRoot as current directory
31223187
*/
@@ -3135,6 +3200,11 @@ declare namespace ts {
31353200
private safelist;
31363201
private readonly legacySafelist;
31373202
private pendingProjectUpdates;
3203+
/**
3204+
* All the open script info that needs recalculation of the default project,
3205+
* this also caches config file info before config file change was detected to use it in case projects are not updated yet
3206+
*/
3207+
private pendingOpenFileProjectUpdates?;
31383208
readonly currentDirectory: NormalizedPath;
31393209
readonly toCanonicalFileName: (f: string) => string;
31403210
readonly host: ServerHost;
@@ -3166,6 +3236,11 @@ declare namespace ts {
31663236
setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.InferredProjectCompilerOptions, projectRootPath?: string): void;
31673237
findProject(projectName: string): Project | undefined;
31683238
getDefaultProjectForFile(fileName: NormalizedPath, ensureProject: boolean): Project | undefined;
3239+
/**
3240+
* If there is default project calculation pending for this file,
3241+
* then it completes that calculation so that correct default project is used for the project
3242+
*/
3243+
private tryGetDefaultProjectForEnsuringConfiguredProjectForFile;
31693244
private doEnsureDefaultProjectForFile;
31703245
getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName: string): ScriptInfo | undefined;
31713246
/**
@@ -3185,13 +3260,6 @@ declare namespace ts {
31853260
private delayUpdateSourceInfoProjects;
31863261
private delayUpdateProjectsOfScriptInfoPath;
31873262
private handleDeletedFile;
3188-
/**
3189-
* This function goes through all the openFiles and tries to file the config file for them.
3190-
* If the config file is found and it refers to existing project, it schedules the reload it for reload
3191-
* If there is no existing project it just opens the configured project for the config file
3192-
* shouldReloadProjectFor provides a way to filter out files to reload configured project for
3193-
*/
3194-
private delayReloadConfiguredProjectsForFile;
31953263
private removeProject;
31963264
private assignOrphanScriptInfosToInferredProject;
31973265
/**
@@ -3201,14 +3269,6 @@ declare namespace ts {
32013269
private closeOpenFile;
32023270
private deleteScriptInfo;
32033271
private configFileExists;
3204-
/**
3205-
* Returns true if the configFileExistenceInfo is needed/impacted by open files that are root of inferred project
3206-
*/
3207-
private configFileExistenceImpactsRootOfInferredProject;
3208-
/**
3209-
* This is called on file close, so that we stop watching the config file for this script info
3210-
*/
3211-
private stopWatchingConfigFilesForClosedScriptInfo;
32123272
/**
32133273
* This function tries to search for a tsconfig.json for the given file.
32143274
* This is different from the method the compiler uses because
@@ -3218,17 +3278,10 @@ declare namespace ts {
32183278
* the newly opened file.
32193279
*/
32203280
private forEachConfigFileLocation;
3221-
/**
3222-
* This function tries to search for a tsconfig.json for the given file.
3223-
* This is different from the method the compiler uses because
3224-
* the compiler can assume it will always start searching in the
3225-
* current directory (the directory in which tsc was invoked).
3226-
* The server must start searching from the directory containing
3227-
* the newly opened file.
3228-
* If script info is passed in, it is asserted to be open script info
3229-
* otherwise just file name
3230-
*/
3231-
private getConfigFileNameForFile;
3281+
/** Get cached configFileName for scriptInfo or ancestor of open script info */
3282+
private getConfigFileNameForFileFromCache;
3283+
/** Caches the configFilename for script info or ancestor of open script info */
3284+
private setConfigFileNameForFileInCache;
32323285
private printProjects;
32333286
private getConfiguredProjectByCanonicalConfigFilePath;
32343287
private findExternalProjectByProjectName;
@@ -3269,12 +3322,6 @@ declare namespace ts {
32693322
* This does not reload contents of open files from disk. But we could do that if needed
32703323
*/
32713324
reloadProjects(): void;
3272-
/**
3273-
* This function goes through all the openFiles and tries to file the config file for them.
3274-
* If the config file is found and it refers to existing project, it reloads it either immediately
3275-
* If there is no existing project it just opens the configured project for the config file
3276-
*/
3277-
private reloadConfiguredProjectForFiles;
32783325
/**
32793326
* Remove the root of inferred project if script info is part of another project
32803327
*/
@@ -3296,11 +3343,21 @@ declare namespace ts {
32963343
private findExternalProjectContainingOpenScriptInfo;
32973344
private getOrCreateOpenScriptInfo;
32983345
private assignProjectToOpenedScriptInfo;
3299-
private createAncestorProjects;
3346+
/**
3347+
* Finds the default configured project for given info
3348+
* For any tsconfig found, it looks into that project, if not then all its references,
3349+
* The search happens for all tsconfigs till projectRootPath
3350+
*/
3351+
private tryFindDefaultConfiguredProjectForOpenScriptInfo;
3352+
/**
3353+
* Finds the default configured project, if found, it creates the solution projects (does not load them right away)
3354+
* with Find: finds the projects even if the project is deferredClosed
3355+
*/
3356+
private tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo;
33003357
private ensureProjectChildren;
3301-
private cleanupAfterOpeningFile;
3358+
private cleanupConfiguredProjects;
3359+
private cleanupProjectsAndScriptInfos;
33023360
openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult;
3303-
private removeOrphanConfiguredProjects;
33043361
private removeOrphanScriptInfos;
33053362
private telemetryOnOpenFile;
33063363
/**
@@ -3309,7 +3366,6 @@ declare namespace ts {
33093366
*/
33103367
closeClientFile(uncheckedFileName: string): void;
33113368
private collectChanges;
3312-
private closeConfiguredProjectReferencedFromExternalProject;
33133369
closeExternalProject(uncheckedFileName: string): void;
33143370
openExternalProjects(projects: protocol.ExternalProject[]): void;
33153371
/** Makes a filename safe to insert in a RegExp */
@@ -3440,6 +3496,7 @@ declare namespace ts {
34403496
private getLinkedEditingRange;
34413497
private getDocumentHighlights;
34423498
private provideInlayHints;
3499+
private mapCode;
34433500
private setCompilerOptionsForInferredProjects;
34443501
private getProjectInfo;
34453502
private getProjectInfoWorker;
@@ -3499,6 +3556,7 @@ declare namespace ts {
34993556
private getApplicableRefactors;
35003557
private getEditsForRefactor;
35013558
private getMoveToRefactoringFileSuggestions;
3559+
private getPasteEdits;
35023560
private organizeImports;
35033561
private getEditsForFileRename;
35043562
private getCodeFixes;
@@ -3507,6 +3565,7 @@ declare namespace ts {
35073565
private getStartAndEndPosition;
35083566
private mapCodeAction;
35093567
private mapCodeFixAction;
3568+
private mapPasteEditsAction;
35103569
private mapTextChangesToCodeEdits;
35113570
private mapTextChangeToCodeEdit;
35123571
private convertTextChangeToCodeEdit;
@@ -9456,6 +9515,7 @@ declare namespace ts {
94569515
interface EmitOutput {
94579516
outputFiles: OutputFile[];
94589517
emitSkipped: boolean;
9518+
diagnostics: readonly Diagnostic[];
94599519
}
94609520
interface OutputFile {
94619521
name: string;
@@ -10102,6 +10162,7 @@ declare namespace ts {
1010210162
uncommentSelection(fileName: string, textRange: TextRange): TextChange[];
1010310163
getSupportedCodeFixes(fileName?: string): readonly string[];
1010410164
dispose(): void;
10165+
getPasteEdits(args: PasteEditsArgs, formatOptions: FormatCodeSettings): PasteEdits;
1010510166
}
1010610167
interface JsxClosingTagInfo {
1010710168
readonly newText: string;
@@ -10119,6 +10180,20 @@ declare namespace ts {
1011910180
SortAndCombine = "SortAndCombine",
1012010181
RemoveUnused = "RemoveUnused",
1012110182
}
10183+
interface PasteEdits {
10184+
edits: readonly FileTextChanges[];
10185+
fixId?: {};
10186+
}
10187+
interface PasteEditsArgs {
10188+
targetFile: string;
10189+
pastedText: string[];
10190+
pasteLocations: TextRange[];
10191+
copiedFrom: {
10192+
file: string;
10193+
range: TextRange[];
10194+
} | undefined;
10195+
preferences: UserPreferences;
10196+
}
1012210197
interface OrganizeImportsArgs extends CombinedCodeFixScope {
1012310198
/** @deprecated Use `mode` instead */
1012410199
skipDestructiveCodeActions?: boolean;

0 commit comments

Comments
 (0)