typescript 4.8.0-dev.20220523 → 4.8.0-dev.20220526
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.
- package/lib/protocol.d.ts +1 -0
- package/lib/tsc.js +88 -51
- package/lib/tsserver.js +117 -64
- package/lib/tsserverlibrary.d.ts +2 -0
- package/lib/tsserverlibrary.js +117 -64
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +117 -64
- package/lib/typescriptServices.d.ts +1 -0
- package/lib/typescriptServices.js +117 -64
- package/lib/typingsInstaller.js +112 -64
- package/package.json +1 -1
package/lib/protocol.d.ts
CHANGED
|
@@ -2699,6 +2699,7 @@ declare namespace ts.server.protocol {
|
|
|
2699
2699
|
readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
|
|
2700
2700
|
readonly includeInlayFunctionParameterTypeHints?: boolean;
|
|
2701
2701
|
readonly includeInlayVariableTypeHints?: boolean;
|
|
2702
|
+
readonly includeInlayVariableTypeHintsWhenTypeMatchesName?: boolean;
|
|
2702
2703
|
readonly includeInlayPropertyDeclarationTypeHints?: boolean;
|
|
2703
2704
|
readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
|
|
2704
2705
|
readonly includeInlayEnumMemberValueHints?: boolean;
|
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.8";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220526";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -34266,7 +34266,7 @@ var ts;
|
|
|
34266
34266
|
}
|
|
34267
34267
|
if (ts.isImplicitGlob(spec.substring(spec.lastIndexOf(ts.directorySeparator) + 1))) {
|
|
34268
34268
|
return {
|
|
34269
|
-
key: useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec),
|
|
34269
|
+
key: ts.removeTrailingDirectorySeparator(useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec)),
|
|
34270
34270
|
flags: 1
|
|
34271
34271
|
};
|
|
34272
34272
|
}
|
|
@@ -35199,15 +35199,19 @@ var ts;
|
|
|
35199
35199
|
function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
35200
35200
|
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
35201
35201
|
}
|
|
35202
|
-
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
35203
|
-
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
35204
|
-
var esmMode = resolutionMode === ts.ModuleKind.ESNext ? NodeResolutionFeatures.EsmMode : 0;
|
|
35205
|
-
return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions, redirectedReference);
|
|
35206
|
-
}
|
|
35207
35202
|
var jsOnlyExtensions = [Extensions.JavaScript];
|
|
35208
35203
|
var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
|
|
35209
35204
|
var tsPlusJsonExtensions = __spreadArray(__spreadArray([], tsExtensions, true), [Extensions.Json], false);
|
|
35210
35205
|
var tsconfigExtensions = [Extensions.TSConfig];
|
|
35206
|
+
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
35207
|
+
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
35208
|
+
var esmMode = resolutionMode === ts.ModuleKind.ESNext ? NodeResolutionFeatures.EsmMode : 0;
|
|
35209
|
+
var extensions = compilerOptions.noDtsResolution ? [Extensions.TsOnly, Extensions.JavaScript] : tsExtensions;
|
|
35210
|
+
if (compilerOptions.resolveJsonModule) {
|
|
35211
|
+
extensions = __spreadArray(__spreadArray([], extensions, true), [Extensions.Json], false);
|
|
35212
|
+
}
|
|
35213
|
+
return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference);
|
|
35214
|
+
}
|
|
35211
35215
|
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
35212
35216
|
return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, undefined, jsOnlyExtensions, undefined);
|
|
35213
35217
|
}
|
|
@@ -51631,7 +51635,7 @@ var ts;
|
|
|
51631
51635
|
function substituteIndexedMappedType(objectType, index) {
|
|
51632
51636
|
var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [index]);
|
|
51633
51637
|
var templateMapper = combineTypeMappers(objectType.mapper, mapper);
|
|
51634
|
-
return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper);
|
|
51638
|
+
return instantiateType(getTemplateTypeFromMappedType(objectType.target || objectType), templateMapper);
|
|
51635
51639
|
}
|
|
51636
51640
|
function getIndexedAccessType(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) {
|
|
51637
51641
|
if (accessFlags === void 0) { accessFlags = 0; }
|
|
@@ -60320,7 +60324,7 @@ var ts;
|
|
|
60320
60324
|
if (result) {
|
|
60321
60325
|
return result;
|
|
60322
60326
|
}
|
|
60323
|
-
if (!(contextFlags & 8) && ts.isBindingPattern(declaration.name)) {
|
|
60327
|
+
if (!(contextFlags & 8) && ts.isBindingPattern(declaration.name) && declaration.name.elements.length > 0) {
|
|
60324
60328
|
return getTypeFromBindingPattern(declaration.name, true, false);
|
|
60325
60329
|
}
|
|
60326
60330
|
}
|
|
@@ -60737,16 +60741,14 @@ var ts;
|
|
|
60737
60741
|
function instantiateContextualType(contextualType, node, contextFlags) {
|
|
60738
60742
|
if (contextualType && maybeTypeOfKind(contextualType, 465829888)) {
|
|
60739
60743
|
var inferenceContext = getInferenceContext(node);
|
|
60740
|
-
if (inferenceContext && ts.some(inferenceContext.inferences, hasInferenceCandidates)) {
|
|
60741
|
-
|
|
60742
|
-
|
|
60743
|
-
|
|
60744
|
-
|
|
60745
|
-
|
|
60746
|
-
|
|
60747
|
-
|
|
60748
|
-
type;
|
|
60749
|
-
}
|
|
60744
|
+
if (inferenceContext && contextFlags & 1 && ts.some(inferenceContext.inferences, hasInferenceCandidates)) {
|
|
60745
|
+
return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
60746
|
+
}
|
|
60747
|
+
if (inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.returnMapper) {
|
|
60748
|
+
var type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
|
|
60749
|
+
return type.flags & 1048576 && containsType(type.types, regularFalseType) && containsType(type.types, regularTrueType) ?
|
|
60750
|
+
filterType(type, function (t) { return t !== regularFalseType && t !== regularTrueType; }) :
|
|
60751
|
+
type;
|
|
60750
60752
|
}
|
|
60751
60753
|
}
|
|
60752
60754
|
return contextualType;
|
|
@@ -62900,18 +62902,22 @@ var ts;
|
|
|
62900
62902
|
return inferJsxTypeArguments(node, signature, checkMode, context);
|
|
62901
62903
|
}
|
|
62902
62904
|
if (node.kind !== 165) {
|
|
62903
|
-
var
|
|
62905
|
+
var skipBindingPatterns = ts.every(signature.typeParameters, function (p) { return !!getDefaultFromTypeParameter(p); });
|
|
62906
|
+
var contextualType = getContextualType(node, skipBindingPatterns ? 8 : 0);
|
|
62904
62907
|
if (contextualType) {
|
|
62905
62908
|
var inferenceTargetType = getReturnTypeOfSignature(signature);
|
|
62906
62909
|
if (couldContainTypeVariables(inferenceTargetType)) {
|
|
62907
62910
|
var outerContext = getInferenceContext(node);
|
|
62908
|
-
var
|
|
62909
|
-
|
|
62910
|
-
|
|
62911
|
-
|
|
62912
|
-
|
|
62913
|
-
|
|
62914
|
-
|
|
62911
|
+
var isFromBindingPattern = !skipBindingPatterns && getContextualType(node, 8) !== contextualType;
|
|
62912
|
+
if (!isFromBindingPattern) {
|
|
62913
|
+
var outerMapper = getMapperFromContext(cloneInferenceContext(outerContext, 1));
|
|
62914
|
+
var instantiatedType = instantiateType(contextualType, outerMapper);
|
|
62915
|
+
var contextualSignature = getSingleCallSignature(instantiatedType);
|
|
62916
|
+
var inferenceSourceType = contextualSignature && contextualSignature.typeParameters ?
|
|
62917
|
+
getOrCreateTypeFromSignature(getSignatureInstantiationWithoutFillingInTypeArguments(contextualSignature, contextualSignature.typeParameters)) :
|
|
62918
|
+
instantiatedType;
|
|
62919
|
+
inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 128);
|
|
62920
|
+
}
|
|
62915
62921
|
var returnContext = createInferenceContext(signature.typeParameters, signature, context.flags);
|
|
62916
62922
|
var returnSourceType = instantiateType(contextualType, outerContext && outerContext.returnMapper);
|
|
62917
62923
|
inferTypes(returnContext.inferences, returnSourceType, inferenceTargetType);
|
|
@@ -87835,7 +87841,7 @@ var ts;
|
|
|
87835
87841
|
function visitor(node) {
|
|
87836
87842
|
switch (node.kind) {
|
|
87837
87843
|
case 265:
|
|
87838
|
-
return ts.
|
|
87844
|
+
return ts.getEmitModuleKind(compilerOptions) >= ts.ModuleKind.Node16 ? visitImportEqualsDeclaration(node) : undefined;
|
|
87839
87845
|
case 271:
|
|
87840
87846
|
return visitExportAssignment(node);
|
|
87841
87847
|
case 272:
|
|
@@ -102343,6 +102349,7 @@ var ts;
|
|
|
102343
102349
|
}
|
|
102344
102350
|
function reloadFileNamesFromConfigFile() {
|
|
102345
102351
|
writeLog("Reloading new file names and options");
|
|
102352
|
+
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
|
|
102346
102353
|
rootFileNames = ts.getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
|
|
102347
102354
|
if (ts.updateErrorForNoInputFiles(rootFileNames, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
|
|
102348
102355
|
hasChangedConfigFileParsingErrors = true;
|
|
@@ -102742,7 +102749,6 @@ var ts;
|
|
|
102742
102749
|
allProjectBuildPending: true,
|
|
102743
102750
|
needsSummary: true,
|
|
102744
102751
|
watchAllProjectsPending: watch,
|
|
102745
|
-
currentInvalidatedProject: undefined,
|
|
102746
102752
|
watch: watch,
|
|
102747
102753
|
allWatchedWildcardDirectories: new ts.Map(),
|
|
102748
102754
|
allWatchedInputFiles: new ts.Map(),
|
|
@@ -102967,7 +102973,6 @@ var ts;
|
|
|
102967
102973
|
})(InvalidatedProjectKind = ts.InvalidatedProjectKind || (ts.InvalidatedProjectKind = {}));
|
|
102968
102974
|
function doneInvalidatedProject(state, projectPath) {
|
|
102969
102975
|
state.projectPendingBuild.delete(projectPath);
|
|
102970
|
-
state.currentInvalidatedProject = undefined;
|
|
102971
102976
|
return state.diagnostics.has(projectPath) ?
|
|
102972
102977
|
ts.ExitStatus.DiagnosticsPresent_OutputsSkipped :
|
|
102973
102978
|
ts.ExitStatus.Success;
|
|
@@ -103302,16 +103307,11 @@ var ts;
|
|
|
103302
103307
|
!!ts.getConfigFileParsingDiagnostics(config).length ||
|
|
103303
103308
|
!ts.isIncrementalCompilation(config.options);
|
|
103304
103309
|
}
|
|
103305
|
-
function
|
|
103310
|
+
function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
|
|
103306
103311
|
if (!state.projectPendingBuild.size)
|
|
103307
103312
|
return undefined;
|
|
103308
103313
|
if (isCircularBuildOrder(buildOrder))
|
|
103309
103314
|
return undefined;
|
|
103310
|
-
if (state.currentInvalidatedProject) {
|
|
103311
|
-
return ts.arrayIsEqualTo(state.currentInvalidatedProject.buildOrder, buildOrder) ?
|
|
103312
|
-
state.currentInvalidatedProject :
|
|
103313
|
-
undefined;
|
|
103314
|
-
}
|
|
103315
103315
|
var options = state.options, projectPendingBuild = state.projectPendingBuild;
|
|
103316
103316
|
for (var projectIndex = 0; projectIndex < buildOrder.length; projectIndex++) {
|
|
103317
103317
|
var project = buildOrder[projectIndex];
|
|
@@ -103343,9 +103343,9 @@ var ts;
|
|
|
103343
103343
|
watchPackageJsonFiles(state, project, projectPath, config);
|
|
103344
103344
|
}
|
|
103345
103345
|
var status = getUpToDateStatus(state, config, projectPath);
|
|
103346
|
-
verboseReportProjectStatus(state, project, status);
|
|
103347
103346
|
if (!options.force) {
|
|
103348
103347
|
if (status.type === ts.UpToDateStatusType.UpToDate) {
|
|
103348
|
+
verboseReportProjectStatus(state, project, status);
|
|
103349
103349
|
reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
|
|
103350
103350
|
projectPendingBuild.delete(projectPath);
|
|
103351
103351
|
if (options.dry) {
|
|
@@ -103355,10 +103355,18 @@ var ts;
|
|
|
103355
103355
|
}
|
|
103356
103356
|
if (status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes) {
|
|
103357
103357
|
reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
|
|
103358
|
-
return
|
|
103358
|
+
return {
|
|
103359
|
+
kind: InvalidatedProjectKind.UpdateOutputFileStamps,
|
|
103360
|
+
status: status,
|
|
103361
|
+
project: project,
|
|
103362
|
+
projectPath: projectPath,
|
|
103363
|
+
projectIndex: projectIndex,
|
|
103364
|
+
config: config
|
|
103365
|
+
};
|
|
103359
103366
|
}
|
|
103360
103367
|
}
|
|
103361
103368
|
if (status.type === ts.UpToDateStatusType.UpstreamBlocked) {
|
|
103369
|
+
verboseReportProjectStatus(state, project, status);
|
|
103362
103370
|
reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
|
|
103363
103371
|
projectPendingBuild.delete(projectPath);
|
|
103364
103372
|
if (options.verbose) {
|
|
@@ -103369,16 +103377,36 @@ var ts;
|
|
|
103369
103377
|
continue;
|
|
103370
103378
|
}
|
|
103371
103379
|
if (status.type === ts.UpToDateStatusType.ContainerOnly) {
|
|
103380
|
+
verboseReportProjectStatus(state, project, status);
|
|
103372
103381
|
reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
|
|
103373
103382
|
projectPendingBuild.delete(projectPath);
|
|
103374
103383
|
continue;
|
|
103375
103384
|
}
|
|
103376
|
-
return
|
|
103377
|
-
|
|
103378
|
-
|
|
103385
|
+
return {
|
|
103386
|
+
kind: needsBuild(state, status, config) ?
|
|
103387
|
+
InvalidatedProjectKind.Build :
|
|
103388
|
+
InvalidatedProjectKind.UpdateBundle,
|
|
103389
|
+
status: status,
|
|
103390
|
+
project: project,
|
|
103391
|
+
projectPath: projectPath,
|
|
103392
|
+
projectIndex: projectIndex,
|
|
103393
|
+
config: config,
|
|
103394
|
+
};
|
|
103379
103395
|
}
|
|
103380
103396
|
return undefined;
|
|
103381
103397
|
}
|
|
103398
|
+
function createInvalidatedProjectWithInfo(state, info, buildOrder) {
|
|
103399
|
+
verboseReportProjectStatus(state, info.project, info.status);
|
|
103400
|
+
return info.kind !== InvalidatedProjectKind.UpdateOutputFileStamps ?
|
|
103401
|
+
createBuildOrUpdateInvalidedProject(info.kind, state, info.project, info.projectPath, info.projectIndex, info.config, buildOrder) :
|
|
103402
|
+
createUpdateOutputFileStampsProject(state, info.project, info.projectPath, info.config, buildOrder);
|
|
103403
|
+
}
|
|
103404
|
+
function getNextInvalidatedProject(state, buildOrder, reportQueue) {
|
|
103405
|
+
var info = getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue);
|
|
103406
|
+
if (!info)
|
|
103407
|
+
return info;
|
|
103408
|
+
return createInvalidatedProjectWithInfo(state, info, buildOrder);
|
|
103409
|
+
}
|
|
103382
103410
|
function listEmittedFile(_a, proj, file) {
|
|
103383
103411
|
var write = _a.write;
|
|
103384
103412
|
if (write && proj.options.listEmittedFiles) {
|
|
@@ -103782,9 +103810,9 @@ var ts;
|
|
|
103782
103810
|
function invalidateProjectAndScheduleBuilds(state, resolvedPath, reloadLevel) {
|
|
103783
103811
|
state.reportFileChangeDetected = true;
|
|
103784
103812
|
invalidateProject(state, resolvedPath, reloadLevel);
|
|
103785
|
-
scheduleBuildInvalidatedProject(state);
|
|
103813
|
+
scheduleBuildInvalidatedProject(state, 250, true);
|
|
103786
103814
|
}
|
|
103787
|
-
function scheduleBuildInvalidatedProject(state) {
|
|
103815
|
+
function scheduleBuildInvalidatedProject(state, time, changeDetected) {
|
|
103788
103816
|
var hostWithWatch = state.hostWithWatch;
|
|
103789
103817
|
if (!hostWithWatch.setTimeout || !hostWithWatch.clearTimeout) {
|
|
103790
103818
|
return;
|
|
@@ -103792,24 +103820,35 @@ var ts;
|
|
|
103792
103820
|
if (state.timerToBuildInvalidatedProject) {
|
|
103793
103821
|
hostWithWatch.clearTimeout(state.timerToBuildInvalidatedProject);
|
|
103794
103822
|
}
|
|
103795
|
-
state.timerToBuildInvalidatedProject = hostWithWatch.setTimeout(buildNextInvalidatedProject,
|
|
103823
|
+
state.timerToBuildInvalidatedProject = hostWithWatch.setTimeout(buildNextInvalidatedProject, time, state, changeDetected);
|
|
103796
103824
|
}
|
|
103797
|
-
function buildNextInvalidatedProject(state) {
|
|
103825
|
+
function buildNextInvalidatedProject(state, changeDetected) {
|
|
103798
103826
|
state.timerToBuildInvalidatedProject = undefined;
|
|
103799
103827
|
if (state.reportFileChangeDetected) {
|
|
103800
103828
|
state.reportFileChangeDetected = false;
|
|
103801
103829
|
state.projectErrorsReported.clear();
|
|
103802
103830
|
reportWatchStatus(state, ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
103803
103831
|
}
|
|
103832
|
+
var projectsBuilt = 0;
|
|
103804
103833
|
var buildOrder = getBuildOrder(state);
|
|
103805
103834
|
var invalidatedProject = getNextInvalidatedProject(state, buildOrder, false);
|
|
103806
103835
|
if (invalidatedProject) {
|
|
103807
103836
|
invalidatedProject.done();
|
|
103808
|
-
|
|
103809
|
-
|
|
103810
|
-
|
|
103837
|
+
projectsBuilt++;
|
|
103838
|
+
while (state.projectPendingBuild.size) {
|
|
103839
|
+
if (state.timerToBuildInvalidatedProject)
|
|
103840
|
+
return;
|
|
103841
|
+
var info = getNextInvalidatedProjectCreateInfo(state, buildOrder, false);
|
|
103842
|
+
if (!info)
|
|
103843
|
+
break;
|
|
103844
|
+
if (info.kind !== InvalidatedProjectKind.UpdateOutputFileStamps && (changeDetected || projectsBuilt === 5)) {
|
|
103845
|
+
scheduleBuildInvalidatedProject(state, 100, false);
|
|
103846
|
+
return;
|
|
103811
103847
|
}
|
|
103812
|
-
|
|
103848
|
+
var project = createInvalidatedProjectWithInfo(state, info, buildOrder);
|
|
103849
|
+
project.done();
|
|
103850
|
+
if (info.kind !== InvalidatedProjectKind.UpdateOutputFileStamps)
|
|
103851
|
+
projectsBuilt++;
|
|
103813
103852
|
}
|
|
103814
103853
|
}
|
|
103815
103854
|
disableCache(state);
|
|
@@ -103909,8 +103948,6 @@ var ts;
|
|
|
103909
103948
|
return getUpToDateStatus(state, parseConfigFile(state, configFileName, configFilePath), configFilePath);
|
|
103910
103949
|
},
|
|
103911
103950
|
invalidateProject: function (configFilePath, reloadLevel) { return invalidateProject(state, configFilePath, reloadLevel || ts.ConfigFileProgramReloadLevel.None); },
|
|
103912
|
-
buildNextInvalidatedProject: function () { return buildNextInvalidatedProject(state); },
|
|
103913
|
-
getAllParsedConfigs: function () { return ts.arrayFrom(ts.mapDefinedIterator(state.configFileCache.values(), function (config) { return isParsedCommandLine(config) ? config : undefined; })); },
|
|
103914
103951
|
close: function () { return stopWatching(state); },
|
|
103915
103952
|
};
|
|
103916
103953
|
}
|