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/tsserverlibrary.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220526";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -42237,7 +42237,7 @@ var ts;
|
|
|
42237
42237
|
}
|
|
42238
42238
|
if (ts.isImplicitGlob(spec.substring(spec.lastIndexOf(ts.directorySeparator) + 1))) {
|
|
42239
42239
|
return {
|
|
42240
|
-
key: useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec),
|
|
42240
|
+
key: ts.removeTrailingDirectorySeparator(useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec)),
|
|
42241
42241
|
flags: 1 /* Recursive */
|
|
42242
42242
|
};
|
|
42243
42243
|
}
|
|
@@ -43342,16 +43342,20 @@ var ts;
|
|
|
43342
43342
|
function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
43343
43343
|
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
43344
43344
|
}
|
|
43345
|
+
var jsOnlyExtensions = [Extensions.JavaScript];
|
|
43346
|
+
var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
|
|
43347
|
+
var tsPlusJsonExtensions = __spreadArray(__spreadArray([], tsExtensions, true), [Extensions.Json], false);
|
|
43348
|
+
var tsconfigExtensions = [Extensions.TSConfig];
|
|
43345
43349
|
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
43346
43350
|
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
43347
43351
|
// es module file or cjs-like input file, use a variant of the legacy cjs resolver that supports the selected modern features
|
|
43348
43352
|
var esmMode = resolutionMode === ts.ModuleKind.ESNext ? NodeResolutionFeatures.EsmMode : 0;
|
|
43349
|
-
|
|
43353
|
+
var extensions = compilerOptions.noDtsResolution ? [Extensions.TsOnly, Extensions.JavaScript] : tsExtensions;
|
|
43354
|
+
if (compilerOptions.resolveJsonModule) {
|
|
43355
|
+
extensions = __spreadArray(__spreadArray([], extensions, true), [Extensions.Json], false);
|
|
43356
|
+
}
|
|
43357
|
+
return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference);
|
|
43350
43358
|
}
|
|
43351
|
-
var jsOnlyExtensions = [Extensions.JavaScript];
|
|
43352
|
-
var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
|
|
43353
|
-
var tsPlusJsonExtensions = __spreadArray(__spreadArray([], tsExtensions, true), [Extensions.Json], false);
|
|
43354
|
-
var tsconfigExtensions = [Extensions.TSConfig];
|
|
43355
43359
|
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
43356
43360
|
return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, jsOnlyExtensions, /*redirectedReferences*/ undefined);
|
|
43357
43361
|
}
|
|
@@ -62378,7 +62382,7 @@ var ts;
|
|
|
62378
62382
|
function substituteIndexedMappedType(objectType, index) {
|
|
62379
62383
|
var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [index]);
|
|
62380
62384
|
var templateMapper = combineTypeMappers(objectType.mapper, mapper);
|
|
62381
|
-
return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper);
|
|
62385
|
+
return instantiateType(getTemplateTypeFromMappedType(objectType.target || objectType), templateMapper);
|
|
62382
62386
|
}
|
|
62383
62387
|
function getIndexedAccessType(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) {
|
|
62384
62388
|
if (accessFlags === void 0) { accessFlags = 0 /* None */; }
|
|
@@ -72490,7 +72494,7 @@ var ts;
|
|
|
72490
72494
|
if (result) {
|
|
72491
72495
|
return result;
|
|
72492
72496
|
}
|
|
72493
|
-
if (!(contextFlags & 8 /* SkipBindingPatterns */) && ts.isBindingPattern(declaration.name)
|
|
72497
|
+
if (!(contextFlags & 8 /* SkipBindingPatterns */) && ts.isBindingPattern(declaration.name) && declaration.name.elements.length > 0) {
|
|
72494
72498
|
return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ true, /*reportErrors*/ false);
|
|
72495
72499
|
}
|
|
72496
72500
|
}
|
|
@@ -72959,22 +72963,20 @@ var ts;
|
|
|
72959
72963
|
var inferenceContext = getInferenceContext(node);
|
|
72960
72964
|
// If no inferences have been made, nothing is gained from instantiating as type parameters
|
|
72961
72965
|
// would just be replaced with their defaults similar to the apparent type.
|
|
72962
|
-
if (inferenceContext && ts.some(inferenceContext.inferences, hasInferenceCandidates)) {
|
|
72966
|
+
if (inferenceContext && contextFlags & 1 /* Signature */ && ts.some(inferenceContext.inferences, hasInferenceCandidates)) {
|
|
72963
72967
|
// For contextual signatures we incorporate all inferences made so far, e.g. from return
|
|
72964
72968
|
// types as well as arguments to the left in a function call.
|
|
72965
|
-
|
|
72966
|
-
|
|
72967
|
-
|
|
72969
|
+
return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
72970
|
+
}
|
|
72971
|
+
if (inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.returnMapper) {
|
|
72968
72972
|
// For other purposes (e.g. determining whether to produce literal types) we only
|
|
72969
72973
|
// incorporate inferences made from the return type in a function call. We remove
|
|
72970
72974
|
// the 'boolean' type from the contextual type such that contextually typed boolean
|
|
72971
72975
|
// literals actually end up widening to 'boolean' (see #48363).
|
|
72972
|
-
|
|
72973
|
-
|
|
72974
|
-
|
|
72975
|
-
|
|
72976
|
-
type;
|
|
72977
|
-
}
|
|
72976
|
+
var type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
|
|
72977
|
+
return type.flags & 1048576 /* Union */ && containsType(type.types, regularFalseType) && containsType(type.types, regularTrueType) ?
|
|
72978
|
+
filterType(type, function (t) { return t !== regularFalseType && t !== regularTrueType; }) :
|
|
72979
|
+
type;
|
|
72978
72980
|
}
|
|
72979
72981
|
}
|
|
72980
72982
|
return contextualType;
|
|
@@ -75508,29 +75510,43 @@ var ts;
|
|
|
75508
75510
|
// 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the
|
|
75509
75511
|
// return type of 'wrap'.
|
|
75510
75512
|
if (node.kind !== 165 /* Decorator */) {
|
|
75511
|
-
var
|
|
75513
|
+
var skipBindingPatterns = ts.every(signature.typeParameters, function (p) { return !!getDefaultFromTypeParameter(p); });
|
|
75514
|
+
var contextualType = getContextualType(node, skipBindingPatterns ? 8 /* SkipBindingPatterns */ : 0 /* None */);
|
|
75512
75515
|
if (contextualType) {
|
|
75513
75516
|
var inferenceTargetType = getReturnTypeOfSignature(signature);
|
|
75514
75517
|
if (couldContainTypeVariables(inferenceTargetType)) {
|
|
75515
|
-
// We clone the inference context to avoid disturbing a resolution in progress for an
|
|
75516
|
-
// outer call expression. Effectively we just want a snapshot of whatever has been
|
|
75517
|
-
// inferred for any outer call expression so far.
|
|
75518
75518
|
var outerContext = getInferenceContext(node);
|
|
75519
|
-
var
|
|
75520
|
-
|
|
75521
|
-
//
|
|
75522
|
-
//
|
|
75523
|
-
//
|
|
75524
|
-
//
|
|
75525
|
-
// declare function
|
|
75526
|
-
// const
|
|
75527
|
-
//
|
|
75528
|
-
|
|
75529
|
-
|
|
75530
|
-
|
|
75531
|
-
|
|
75532
|
-
|
|
75533
|
-
|
|
75519
|
+
var isFromBindingPattern = !skipBindingPatterns && getContextualType(node, 8 /* SkipBindingPatterns */) !== contextualType;
|
|
75520
|
+
// A return type inference from a binding pattern can be used in instantiating the contextual
|
|
75521
|
+
// type of an argument later in inference, but cannot stand on its own as the final return type.
|
|
75522
|
+
// It is incorporated into `context.returnMapper` which is used in `instantiateContextualType`,
|
|
75523
|
+
// but doesn't need to go into `context.inferences`. This allows a an array binding pattern to
|
|
75524
|
+
// produce a tuple for `T` in
|
|
75525
|
+
// declare function f<T>(cb: () => T): T;
|
|
75526
|
+
// const [e1, e2, e3] = f(() => [1, "hi", true]);
|
|
75527
|
+
// but does not produce any inference for `T` in
|
|
75528
|
+
// declare function f<T>(): T;
|
|
75529
|
+
// const [e1, e2, e3] = f();
|
|
75530
|
+
if (!isFromBindingPattern) {
|
|
75531
|
+
// We clone the inference context to avoid disturbing a resolution in progress for an
|
|
75532
|
+
// outer call expression. Effectively we just want a snapshot of whatever has been
|
|
75533
|
+
// inferred for any outer call expression so far.
|
|
75534
|
+
var outerMapper = getMapperFromContext(cloneInferenceContext(outerContext, 1 /* NoDefault */));
|
|
75535
|
+
var instantiatedType = instantiateType(contextualType, outerMapper);
|
|
75536
|
+
// If the contextual type is a generic function type with a single call signature, we
|
|
75537
|
+
// instantiate the type with its own type parameters and type arguments. This ensures that
|
|
75538
|
+
// the type parameters are not erased to type any during type inference such that they can
|
|
75539
|
+
// be inferred as actual types from the contextual type. For example:
|
|
75540
|
+
// declare function arrayMap<T, U>(f: (x: T) => U): (a: T[]) => U[];
|
|
75541
|
+
// const boxElements: <A>(a: A[]) => { value: A }[] = arrayMap(value => ({ value }));
|
|
75542
|
+
// Above, the type of the 'value' parameter is inferred to be 'A'.
|
|
75543
|
+
var contextualSignature = getSingleCallSignature(instantiatedType);
|
|
75544
|
+
var inferenceSourceType = contextualSignature && contextualSignature.typeParameters ?
|
|
75545
|
+
getOrCreateTypeFromSignature(getSignatureInstantiationWithoutFillingInTypeArguments(contextualSignature, contextualSignature.typeParameters)) :
|
|
75546
|
+
instantiatedType;
|
|
75547
|
+
// Inferences made from return types have lower priority than all other inferences.
|
|
75548
|
+
inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 128 /* ReturnType */);
|
|
75549
|
+
}
|
|
75534
75550
|
// Create a type mapper for instantiating generic contextual types using the inferences made
|
|
75535
75551
|
// from the return type. We need a separate inference pass here because (a) instantiation of
|
|
75536
75552
|
// the source type uses the outer context's return mapper (which excludes inferences made from
|
|
@@ -107455,7 +107471,7 @@ var ts;
|
|
|
107455
107471
|
// Though an error in es2020 modules, in node-flavor es2020 modules, we can helpfully transform this to a synthetic `require` call
|
|
107456
107472
|
// To give easy access to a synchronous `require` in node-flavor esm. We do the transform even in scenarios where we error, but `import.meta.url`
|
|
107457
107473
|
// is available, just because the output is reasonable for a node-like runtime.
|
|
107458
|
-
return ts.
|
|
107474
|
+
return ts.getEmitModuleKind(compilerOptions) >= ts.ModuleKind.Node16 ? visitImportEqualsDeclaration(node) : undefined;
|
|
107459
107475
|
case 271 /* ExportAssignment */:
|
|
107460
107476
|
return visitExportAssignment(node);
|
|
107461
107477
|
case 272 /* ExportDeclaration */:
|
|
@@ -123829,6 +123845,7 @@ var ts;
|
|
|
123829
123845
|
}
|
|
123830
123846
|
function reloadFileNamesFromConfigFile() {
|
|
123831
123847
|
writeLog("Reloading new file names and options");
|
|
123848
|
+
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
|
|
123832
123849
|
rootFileNames = ts.getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
|
|
123833
123850
|
if (ts.updateErrorForNoInputFiles(rootFileNames, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
|
|
123834
123851
|
hasChangedConfigFileParsingErrors = true;
|
|
@@ -124286,7 +124303,6 @@ var ts;
|
|
|
124286
124303
|
allProjectBuildPending: true,
|
|
124287
124304
|
needsSummary: true,
|
|
124288
124305
|
watchAllProjectsPending: watch,
|
|
124289
|
-
currentInvalidatedProject: undefined,
|
|
124290
124306
|
// Watch state
|
|
124291
124307
|
watch: watch,
|
|
124292
124308
|
allWatchedWildcardDirectories: new ts.Map(),
|
|
@@ -124519,7 +124535,6 @@ var ts;
|
|
|
124519
124535
|
})(InvalidatedProjectKind = ts.InvalidatedProjectKind || (ts.InvalidatedProjectKind = {}));
|
|
124520
124536
|
function doneInvalidatedProject(state, projectPath) {
|
|
124521
124537
|
state.projectPendingBuild.delete(projectPath);
|
|
124522
|
-
state.currentInvalidatedProject = undefined;
|
|
124523
124538
|
return state.diagnostics.has(projectPath) ?
|
|
124524
124539
|
ts.ExitStatus.DiagnosticsPresent_OutputsSkipped :
|
|
124525
124540
|
ts.ExitStatus.Success;
|
|
@@ -124870,17 +124885,11 @@ var ts;
|
|
|
124870
124885
|
!!ts.getConfigFileParsingDiagnostics(config).length ||
|
|
124871
124886
|
!ts.isIncrementalCompilation(config.options);
|
|
124872
124887
|
}
|
|
124873
|
-
function
|
|
124888
|
+
function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
|
|
124874
124889
|
if (!state.projectPendingBuild.size)
|
|
124875
124890
|
return undefined;
|
|
124876
124891
|
if (isCircularBuildOrder(buildOrder))
|
|
124877
124892
|
return undefined;
|
|
124878
|
-
if (state.currentInvalidatedProject) {
|
|
124879
|
-
// Only if same buildOrder the currentInvalidated project can be sent again
|
|
124880
|
-
return ts.arrayIsEqualTo(state.currentInvalidatedProject.buildOrder, buildOrder) ?
|
|
124881
|
-
state.currentInvalidatedProject :
|
|
124882
|
-
undefined;
|
|
124883
|
-
}
|
|
124884
124893
|
var options = state.options, projectPendingBuild = state.projectPendingBuild;
|
|
124885
124894
|
for (var projectIndex = 0; projectIndex < buildOrder.length; projectIndex++) {
|
|
124886
124895
|
var project = buildOrder[projectIndex];
|
|
@@ -124913,9 +124922,9 @@ var ts;
|
|
|
124913
124922
|
watchPackageJsonFiles(state, project, projectPath, config);
|
|
124914
124923
|
}
|
|
124915
124924
|
var status = getUpToDateStatus(state, config, projectPath);
|
|
124916
|
-
verboseReportProjectStatus(state, project, status);
|
|
124917
124925
|
if (!options.force) {
|
|
124918
124926
|
if (status.type === ts.UpToDateStatusType.UpToDate) {
|
|
124927
|
+
verboseReportProjectStatus(state, project, status);
|
|
124919
124928
|
reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
|
|
124920
124929
|
projectPendingBuild.delete(projectPath);
|
|
124921
124930
|
// Up to date, skip
|
|
@@ -124927,10 +124936,18 @@ var ts;
|
|
|
124927
124936
|
}
|
|
124928
124937
|
if (status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes) {
|
|
124929
124938
|
reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
|
|
124930
|
-
return
|
|
124939
|
+
return {
|
|
124940
|
+
kind: InvalidatedProjectKind.UpdateOutputFileStamps,
|
|
124941
|
+
status: status,
|
|
124942
|
+
project: project,
|
|
124943
|
+
projectPath: projectPath,
|
|
124944
|
+
projectIndex: projectIndex,
|
|
124945
|
+
config: config
|
|
124946
|
+
};
|
|
124931
124947
|
}
|
|
124932
124948
|
}
|
|
124933
124949
|
if (status.type === ts.UpToDateStatusType.UpstreamBlocked) {
|
|
124950
|
+
verboseReportProjectStatus(state, project, status);
|
|
124934
124951
|
reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
|
|
124935
124952
|
projectPendingBuild.delete(projectPath);
|
|
124936
124953
|
if (options.verbose) {
|
|
@@ -124941,17 +124958,37 @@ var ts;
|
|
|
124941
124958
|
continue;
|
|
124942
124959
|
}
|
|
124943
124960
|
if (status.type === ts.UpToDateStatusType.ContainerOnly) {
|
|
124961
|
+
verboseReportProjectStatus(state, project, status);
|
|
124944
124962
|
reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
|
|
124945
124963
|
projectPendingBuild.delete(projectPath);
|
|
124946
124964
|
// Do nothing
|
|
124947
124965
|
continue;
|
|
124948
124966
|
}
|
|
124949
|
-
return
|
|
124950
|
-
|
|
124951
|
-
|
|
124967
|
+
return {
|
|
124968
|
+
kind: needsBuild(state, status, config) ?
|
|
124969
|
+
InvalidatedProjectKind.Build :
|
|
124970
|
+
InvalidatedProjectKind.UpdateBundle,
|
|
124971
|
+
status: status,
|
|
124972
|
+
project: project,
|
|
124973
|
+
projectPath: projectPath,
|
|
124974
|
+
projectIndex: projectIndex,
|
|
124975
|
+
config: config,
|
|
124976
|
+
};
|
|
124952
124977
|
}
|
|
124953
124978
|
return undefined;
|
|
124954
124979
|
}
|
|
124980
|
+
function createInvalidatedProjectWithInfo(state, info, buildOrder) {
|
|
124981
|
+
verboseReportProjectStatus(state, info.project, info.status);
|
|
124982
|
+
return info.kind !== InvalidatedProjectKind.UpdateOutputFileStamps ?
|
|
124983
|
+
createBuildOrUpdateInvalidedProject(info.kind, state, info.project, info.projectPath, info.projectIndex, info.config, buildOrder) :
|
|
124984
|
+
createUpdateOutputFileStampsProject(state, info.project, info.projectPath, info.config, buildOrder);
|
|
124985
|
+
}
|
|
124986
|
+
function getNextInvalidatedProject(state, buildOrder, reportQueue) {
|
|
124987
|
+
var info = getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue);
|
|
124988
|
+
if (!info)
|
|
124989
|
+
return info;
|
|
124990
|
+
return createInvalidatedProjectWithInfo(state, info, buildOrder);
|
|
124991
|
+
}
|
|
124955
124992
|
function listEmittedFile(_a, proj, file) {
|
|
124956
124993
|
var write = _a.write;
|
|
124957
124994
|
if (write && proj.options.listEmittedFiles) {
|
|
@@ -125392,9 +125429,9 @@ var ts;
|
|
|
125392
125429
|
function invalidateProjectAndScheduleBuilds(state, resolvedPath, reloadLevel) {
|
|
125393
125430
|
state.reportFileChangeDetected = true;
|
|
125394
125431
|
invalidateProject(state, resolvedPath, reloadLevel);
|
|
125395
|
-
scheduleBuildInvalidatedProject(state);
|
|
125432
|
+
scheduleBuildInvalidatedProject(state, 250, /*changeDetected*/ true);
|
|
125396
125433
|
}
|
|
125397
|
-
function scheduleBuildInvalidatedProject(state) {
|
|
125434
|
+
function scheduleBuildInvalidatedProject(state, time, changeDetected) {
|
|
125398
125435
|
var hostWithWatch = state.hostWithWatch;
|
|
125399
125436
|
if (!hostWithWatch.setTimeout || !hostWithWatch.clearTimeout) {
|
|
125400
125437
|
return;
|
|
@@ -125402,25 +125439,38 @@ var ts;
|
|
|
125402
125439
|
if (state.timerToBuildInvalidatedProject) {
|
|
125403
125440
|
hostWithWatch.clearTimeout(state.timerToBuildInvalidatedProject);
|
|
125404
125441
|
}
|
|
125405
|
-
state.timerToBuildInvalidatedProject = hostWithWatch.setTimeout(buildNextInvalidatedProject,
|
|
125442
|
+
state.timerToBuildInvalidatedProject = hostWithWatch.setTimeout(buildNextInvalidatedProject, time, state, changeDetected);
|
|
125406
125443
|
}
|
|
125407
|
-
function buildNextInvalidatedProject(state) {
|
|
125444
|
+
function buildNextInvalidatedProject(state, changeDetected) {
|
|
125408
125445
|
state.timerToBuildInvalidatedProject = undefined;
|
|
125409
125446
|
if (state.reportFileChangeDetected) {
|
|
125410
125447
|
state.reportFileChangeDetected = false;
|
|
125411
125448
|
state.projectErrorsReported.clear();
|
|
125412
125449
|
reportWatchStatus(state, ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
125413
125450
|
}
|
|
125451
|
+
var projectsBuilt = 0;
|
|
125414
125452
|
var buildOrder = getBuildOrder(state);
|
|
125415
125453
|
var invalidatedProject = getNextInvalidatedProject(state, buildOrder, /*reportQueue*/ false);
|
|
125416
125454
|
if (invalidatedProject) {
|
|
125417
125455
|
invalidatedProject.done();
|
|
125418
|
-
|
|
125419
|
-
|
|
125420
|
-
|
|
125421
|
-
|
|
125456
|
+
projectsBuilt++;
|
|
125457
|
+
while (state.projectPendingBuild.size) {
|
|
125458
|
+
// If already scheduled, skip
|
|
125459
|
+
if (state.timerToBuildInvalidatedProject)
|
|
125460
|
+
return;
|
|
125461
|
+
// Before scheduling check if the next project needs build
|
|
125462
|
+
var info = getNextInvalidatedProjectCreateInfo(state, buildOrder, /*reportQueue*/ false);
|
|
125463
|
+
if (!info)
|
|
125464
|
+
break; // Nothing to build any more
|
|
125465
|
+
if (info.kind !== InvalidatedProjectKind.UpdateOutputFileStamps && (changeDetected || projectsBuilt === 5)) {
|
|
125466
|
+
// Schedule next project for build
|
|
125467
|
+
scheduleBuildInvalidatedProject(state, 100, /*changeDetected*/ false);
|
|
125468
|
+
return;
|
|
125422
125469
|
}
|
|
125423
|
-
|
|
125470
|
+
var project = createInvalidatedProjectWithInfo(state, info, buildOrder);
|
|
125471
|
+
project.done();
|
|
125472
|
+
if (info.kind !== InvalidatedProjectKind.UpdateOutputFileStamps)
|
|
125473
|
+
projectsBuilt++;
|
|
125424
125474
|
}
|
|
125425
125475
|
}
|
|
125426
125476
|
disableCache(state);
|
|
@@ -125524,8 +125574,6 @@ var ts;
|
|
|
125524
125574
|
return getUpToDateStatus(state, parseConfigFile(state, configFileName, configFilePath), configFilePath);
|
|
125525
125575
|
},
|
|
125526
125576
|
invalidateProject: function (configFilePath, reloadLevel) { return invalidateProject(state, configFilePath, reloadLevel || ts.ConfigFileProgramReloadLevel.None); },
|
|
125527
|
-
buildNextInvalidatedProject: function () { return buildNextInvalidatedProject(state); },
|
|
125528
|
-
getAllParsedConfigs: function () { return ts.arrayFrom(ts.mapDefinedIterator(state.configFileCache.values(), function (config) { return isParsedCommandLine(config) ? config : undefined; })); },
|
|
125529
125577
|
close: function () { return stopWatching(state); },
|
|
125530
125578
|
};
|
|
125531
125579
|
}
|
|
@@ -135278,6 +135326,7 @@ var ts;
|
|
|
135278
135326
|
return kind === 131 /* AsyncKeyword */
|
|
135279
135327
|
|| kind === 132 /* AwaitKeyword */
|
|
135280
135328
|
|| kind === 127 /* AsKeyword */
|
|
135329
|
+
|| kind === 152 /* TypeKeyword */
|
|
135281
135330
|
|| !ts.isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind);
|
|
135282
135331
|
}
|
|
135283
135332
|
function keywordForNode(node) {
|
|
@@ -144532,6 +144581,10 @@ var ts;
|
|
|
144532
144581
|
}
|
|
144533
144582
|
var typeDisplayString = printTypeInSingleLine(declarationType);
|
|
144534
144583
|
if (typeDisplayString) {
|
|
144584
|
+
var isVariableNameMatchesType = preferences.includeInlayVariableTypeHintsWhenTypeMatchesName === false && ts.equateStringsCaseInsensitive(decl.name.getText(), typeDisplayString);
|
|
144585
|
+
if (isVariableNameMatchesType) {
|
|
144586
|
+
return;
|
|
144587
|
+
}
|
|
144535
144588
|
addTypeHints(typeDisplayString, decl.name.end);
|
|
144536
144589
|
}
|
|
144537
144590
|
}
|
package/lib/typescript.d.ts
CHANGED
|
@@ -4120,6 +4120,7 @@ declare namespace ts {
|
|
|
4120
4120
|
readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
|
|
4121
4121
|
readonly includeInlayFunctionParameterTypeHints?: boolean;
|
|
4122
4122
|
readonly includeInlayVariableTypeHints?: boolean;
|
|
4123
|
+
readonly includeInlayVariableTypeHintsWhenTypeMatchesName?: boolean;
|
|
4123
4124
|
readonly includeInlayPropertyDeclarationTypeHints?: boolean;
|
|
4124
4125
|
readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
|
|
4125
4126
|
readonly includeInlayEnumMemberValueHints?: boolean;
|