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/tsserver.js CHANGED
@@ -100,7 +100,7 @@ var ts;
100
100
  // The following is baselined as a literal template type without intervention
101
101
  /** The version of the TypeScript compiler release */
102
102
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
103
- ts.version = ts.versionMajorMinor + ".0-dev.20220523";
103
+ ts.version = ts.versionMajorMinor + ".0-dev.20220526";
104
104
  /* @internal */
105
105
  var Comparison;
106
106
  (function (Comparison) {
@@ -42043,7 +42043,7 @@ var ts;
42043
42043
  }
42044
42044
  if (ts.isImplicitGlob(spec.substring(spec.lastIndexOf(ts.directorySeparator) + 1))) {
42045
42045
  return {
42046
- key: useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec),
42046
+ key: ts.removeTrailingDirectorySeparator(useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec)),
42047
42047
  flags: 1 /* Recursive */
42048
42048
  };
42049
42049
  }
@@ -43148,16 +43148,20 @@ var ts;
43148
43148
  function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
43149
43149
  return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
43150
43150
  }
43151
+ var jsOnlyExtensions = [Extensions.JavaScript];
43152
+ var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
43153
+ var tsPlusJsonExtensions = __spreadArray(__spreadArray([], tsExtensions, true), [Extensions.Json], false);
43154
+ var tsconfigExtensions = [Extensions.TSConfig];
43151
43155
  function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
43152
43156
  var containingDirectory = ts.getDirectoryPath(containingFile);
43153
43157
  // es module file or cjs-like input file, use a variant of the legacy cjs resolver that supports the selected modern features
43154
43158
  var esmMode = resolutionMode === ts.ModuleKind.ESNext ? NodeResolutionFeatures.EsmMode : 0;
43155
- return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions, redirectedReference);
43159
+ var extensions = compilerOptions.noDtsResolution ? [Extensions.TsOnly, Extensions.JavaScript] : tsExtensions;
43160
+ if (compilerOptions.resolveJsonModule) {
43161
+ extensions = __spreadArray(__spreadArray([], extensions, true), [Extensions.Json], false);
43162
+ }
43163
+ return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference);
43156
43164
  }
43157
- var jsOnlyExtensions = [Extensions.JavaScript];
43158
- var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
43159
- var tsPlusJsonExtensions = __spreadArray(__spreadArray([], tsExtensions, true), [Extensions.Json], false);
43160
- var tsconfigExtensions = [Extensions.TSConfig];
43161
43165
  function tryResolveJSModuleWorker(moduleName, initialDir, host) {
43162
43166
  return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, jsOnlyExtensions, /*redirectedReferences*/ undefined);
43163
43167
  }
@@ -62184,7 +62188,7 @@ var ts;
62184
62188
  function substituteIndexedMappedType(objectType, index) {
62185
62189
  var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [index]);
62186
62190
  var templateMapper = combineTypeMappers(objectType.mapper, mapper);
62187
- return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper);
62191
+ return instantiateType(getTemplateTypeFromMappedType(objectType.target || objectType), templateMapper);
62188
62192
  }
62189
62193
  function getIndexedAccessType(objectType, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) {
62190
62194
  if (accessFlags === void 0) { accessFlags = 0 /* None */; }
@@ -72296,7 +72300,7 @@ var ts;
72296
72300
  if (result) {
72297
72301
  return result;
72298
72302
  }
72299
- if (!(contextFlags & 8 /* SkipBindingPatterns */) && ts.isBindingPattern(declaration.name)) { // This is less a contextual type and more an implied shape - in some cases, this may be undesirable
72303
+ if (!(contextFlags & 8 /* SkipBindingPatterns */) && ts.isBindingPattern(declaration.name) && declaration.name.elements.length > 0) {
72300
72304
  return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ true, /*reportErrors*/ false);
72301
72305
  }
72302
72306
  }
@@ -72765,22 +72769,20 @@ var ts;
72765
72769
  var inferenceContext = getInferenceContext(node);
72766
72770
  // If no inferences have been made, nothing is gained from instantiating as type parameters
72767
72771
  // would just be replaced with their defaults similar to the apparent type.
72768
- if (inferenceContext && ts.some(inferenceContext.inferences, hasInferenceCandidates)) {
72772
+ if (inferenceContext && contextFlags & 1 /* Signature */ && ts.some(inferenceContext.inferences, hasInferenceCandidates)) {
72769
72773
  // For contextual signatures we incorporate all inferences made so far, e.g. from return
72770
72774
  // types as well as arguments to the left in a function call.
72771
- if (contextFlags && contextFlags & 1 /* Signature */) {
72772
- return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
72773
- }
72775
+ return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
72776
+ }
72777
+ if (inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.returnMapper) {
72774
72778
  // For other purposes (e.g. determining whether to produce literal types) we only
72775
72779
  // incorporate inferences made from the return type in a function call. We remove
72776
72780
  // the 'boolean' type from the contextual type such that contextually typed boolean
72777
72781
  // literals actually end up widening to 'boolean' (see #48363).
72778
- if (inferenceContext.returnMapper) {
72779
- var type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
72780
- return type.flags & 1048576 /* Union */ && containsType(type.types, regularFalseType) && containsType(type.types, regularTrueType) ?
72781
- filterType(type, function (t) { return t !== regularFalseType && t !== regularTrueType; }) :
72782
- type;
72783
- }
72782
+ var type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
72783
+ return type.flags & 1048576 /* Union */ && containsType(type.types, regularFalseType) && containsType(type.types, regularTrueType) ?
72784
+ filterType(type, function (t) { return t !== regularFalseType && t !== regularTrueType; }) :
72785
+ type;
72784
72786
  }
72785
72787
  }
72786
72788
  return contextualType;
@@ -75314,29 +75316,43 @@ var ts;
75314
75316
  // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the
75315
75317
  // return type of 'wrap'.
75316
75318
  if (node.kind !== 165 /* Decorator */) {
75317
- var contextualType = getContextualType(node, ts.every(signature.typeParameters, function (p) { return !!getDefaultFromTypeParameter(p); }) ? 8 /* SkipBindingPatterns */ : 0 /* None */);
75319
+ var skipBindingPatterns = ts.every(signature.typeParameters, function (p) { return !!getDefaultFromTypeParameter(p); });
75320
+ var contextualType = getContextualType(node, skipBindingPatterns ? 8 /* SkipBindingPatterns */ : 0 /* None */);
75318
75321
  if (contextualType) {
75319
75322
  var inferenceTargetType = getReturnTypeOfSignature(signature);
75320
75323
  if (couldContainTypeVariables(inferenceTargetType)) {
75321
- // We clone the inference context to avoid disturbing a resolution in progress for an
75322
- // outer call expression. Effectively we just want a snapshot of whatever has been
75323
- // inferred for any outer call expression so far.
75324
75324
  var outerContext = getInferenceContext(node);
75325
- var outerMapper = getMapperFromContext(cloneInferenceContext(outerContext, 1 /* NoDefault */));
75326
- var instantiatedType = instantiateType(contextualType, outerMapper);
75327
- // If the contextual type is a generic function type with a single call signature, we
75328
- // instantiate the type with its own type parameters and type arguments. This ensures that
75329
- // the type parameters are not erased to type any during type inference such that they can
75330
- // be inferred as actual types from the contextual type. For example:
75331
- // declare function arrayMap<T, U>(f: (x: T) => U): (a: T[]) => U[];
75332
- // const boxElements: <A>(a: A[]) => { value: A }[] = arrayMap(value => ({ value }));
75333
- // Above, the type of the 'value' parameter is inferred to be 'A'.
75334
- var contextualSignature = getSingleCallSignature(instantiatedType);
75335
- var inferenceSourceType = contextualSignature && contextualSignature.typeParameters ?
75336
- getOrCreateTypeFromSignature(getSignatureInstantiationWithoutFillingInTypeArguments(contextualSignature, contextualSignature.typeParameters)) :
75337
- instantiatedType;
75338
- // Inferences made from return types have lower priority than all other inferences.
75339
- inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 128 /* ReturnType */);
75325
+ var isFromBindingPattern = !skipBindingPatterns && getContextualType(node, 8 /* SkipBindingPatterns */) !== contextualType;
75326
+ // A return type inference from a binding pattern can be used in instantiating the contextual
75327
+ // type of an argument later in inference, but cannot stand on its own as the final return type.
75328
+ // It is incorporated into `context.returnMapper` which is used in `instantiateContextualType`,
75329
+ // but doesn't need to go into `context.inferences`. This allows a an array binding pattern to
75330
+ // produce a tuple for `T` in
75331
+ // declare function f<T>(cb: () => T): T;
75332
+ // const [e1, e2, e3] = f(() => [1, "hi", true]);
75333
+ // but does not produce any inference for `T` in
75334
+ // declare function f<T>(): T;
75335
+ // const [e1, e2, e3] = f();
75336
+ if (!isFromBindingPattern) {
75337
+ // We clone the inference context to avoid disturbing a resolution in progress for an
75338
+ // outer call expression. Effectively we just want a snapshot of whatever has been
75339
+ // inferred for any outer call expression so far.
75340
+ var outerMapper = getMapperFromContext(cloneInferenceContext(outerContext, 1 /* NoDefault */));
75341
+ var instantiatedType = instantiateType(contextualType, outerMapper);
75342
+ // If the contextual type is a generic function type with a single call signature, we
75343
+ // instantiate the type with its own type parameters and type arguments. This ensures that
75344
+ // the type parameters are not erased to type any during type inference such that they can
75345
+ // be inferred as actual types from the contextual type. For example:
75346
+ // declare function arrayMap<T, U>(f: (x: T) => U): (a: T[]) => U[];
75347
+ // const boxElements: <A>(a: A[]) => { value: A }[] = arrayMap(value => ({ value }));
75348
+ // Above, the type of the 'value' parameter is inferred to be 'A'.
75349
+ var contextualSignature = getSingleCallSignature(instantiatedType);
75350
+ var inferenceSourceType = contextualSignature && contextualSignature.typeParameters ?
75351
+ getOrCreateTypeFromSignature(getSignatureInstantiationWithoutFillingInTypeArguments(contextualSignature, contextualSignature.typeParameters)) :
75352
+ instantiatedType;
75353
+ // Inferences made from return types have lower priority than all other inferences.
75354
+ inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 128 /* ReturnType */);
75355
+ }
75340
75356
  // Create a type mapper for instantiating generic contextual types using the inferences made
75341
75357
  // from the return type. We need a separate inference pass here because (a) instantiation of
75342
75358
  // the source type uses the outer context's return mapper (which excludes inferences made from
@@ -107261,7 +107277,7 @@ var ts;
107261
107277
  // Though an error in es2020 modules, in node-flavor es2020 modules, we can helpfully transform this to a synthetic `require` call
107262
107278
  // 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`
107263
107279
  // is available, just because the output is reasonable for a node-like runtime.
107264
- return ts.getEmitScriptTarget(compilerOptions) >= ts.ModuleKind.ES2020 ? visitImportEqualsDeclaration(node) : undefined;
107280
+ return ts.getEmitModuleKind(compilerOptions) >= ts.ModuleKind.Node16 ? visitImportEqualsDeclaration(node) : undefined;
107265
107281
  case 271 /* ExportAssignment */:
107266
107282
  return visitExportAssignment(node);
107267
107283
  case 272 /* ExportDeclaration */:
@@ -123635,6 +123651,7 @@ var ts;
123635
123651
  }
123636
123652
  function reloadFileNamesFromConfigFile() {
123637
123653
  writeLog("Reloading new file names and options");
123654
+ reloadLevel = ts.ConfigFileProgramReloadLevel.None;
123638
123655
  rootFileNames = ts.getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
123639
123656
  if (ts.updateErrorForNoInputFiles(rootFileNames, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
123640
123657
  hasChangedConfigFileParsingErrors = true;
@@ -124092,7 +124109,6 @@ var ts;
124092
124109
  allProjectBuildPending: true,
124093
124110
  needsSummary: true,
124094
124111
  watchAllProjectsPending: watch,
124095
- currentInvalidatedProject: undefined,
124096
124112
  // Watch state
124097
124113
  watch: watch,
124098
124114
  allWatchedWildcardDirectories: new ts.Map(),
@@ -124325,7 +124341,6 @@ var ts;
124325
124341
  })(InvalidatedProjectKind = ts.InvalidatedProjectKind || (ts.InvalidatedProjectKind = {}));
124326
124342
  function doneInvalidatedProject(state, projectPath) {
124327
124343
  state.projectPendingBuild.delete(projectPath);
124328
- state.currentInvalidatedProject = undefined;
124329
124344
  return state.diagnostics.has(projectPath) ?
124330
124345
  ts.ExitStatus.DiagnosticsPresent_OutputsSkipped :
124331
124346
  ts.ExitStatus.Success;
@@ -124676,17 +124691,11 @@ var ts;
124676
124691
  !!ts.getConfigFileParsingDiagnostics(config).length ||
124677
124692
  !ts.isIncrementalCompilation(config.options);
124678
124693
  }
124679
- function getNextInvalidatedProject(state, buildOrder, reportQueue) {
124694
+ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
124680
124695
  if (!state.projectPendingBuild.size)
124681
124696
  return undefined;
124682
124697
  if (isCircularBuildOrder(buildOrder))
124683
124698
  return undefined;
124684
- if (state.currentInvalidatedProject) {
124685
- // Only if same buildOrder the currentInvalidated project can be sent again
124686
- return ts.arrayIsEqualTo(state.currentInvalidatedProject.buildOrder, buildOrder) ?
124687
- state.currentInvalidatedProject :
124688
- undefined;
124689
- }
124690
124699
  var options = state.options, projectPendingBuild = state.projectPendingBuild;
124691
124700
  for (var projectIndex = 0; projectIndex < buildOrder.length; projectIndex++) {
124692
124701
  var project = buildOrder[projectIndex];
@@ -124719,9 +124728,9 @@ var ts;
124719
124728
  watchPackageJsonFiles(state, project, projectPath, config);
124720
124729
  }
124721
124730
  var status = getUpToDateStatus(state, config, projectPath);
124722
- verboseReportProjectStatus(state, project, status);
124723
124731
  if (!options.force) {
124724
124732
  if (status.type === ts.UpToDateStatusType.UpToDate) {
124733
+ verboseReportProjectStatus(state, project, status);
124725
124734
  reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
124726
124735
  projectPendingBuild.delete(projectPath);
124727
124736
  // Up to date, skip
@@ -124733,10 +124742,18 @@ var ts;
124733
124742
  }
124734
124743
  if (status.type === ts.UpToDateStatusType.UpToDateWithUpstreamTypes) {
124735
124744
  reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
124736
- return createUpdateOutputFileStampsProject(state, project, projectPath, config, buildOrder);
124745
+ return {
124746
+ kind: InvalidatedProjectKind.UpdateOutputFileStamps,
124747
+ status: status,
124748
+ project: project,
124749
+ projectPath: projectPath,
124750
+ projectIndex: projectIndex,
124751
+ config: config
124752
+ };
124737
124753
  }
124738
124754
  }
124739
124755
  if (status.type === ts.UpToDateStatusType.UpstreamBlocked) {
124756
+ verboseReportProjectStatus(state, project, status);
124740
124757
  reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
124741
124758
  projectPendingBuild.delete(projectPath);
124742
124759
  if (options.verbose) {
@@ -124747,17 +124764,37 @@ var ts;
124747
124764
  continue;
124748
124765
  }
124749
124766
  if (status.type === ts.UpToDateStatusType.ContainerOnly) {
124767
+ verboseReportProjectStatus(state, project, status);
124750
124768
  reportAndStoreErrors(state, projectPath, ts.getConfigFileParsingDiagnostics(config));
124751
124769
  projectPendingBuild.delete(projectPath);
124752
124770
  // Do nothing
124753
124771
  continue;
124754
124772
  }
124755
- return createBuildOrUpdateInvalidedProject(needsBuild(state, status, config) ?
124756
- InvalidatedProjectKind.Build :
124757
- InvalidatedProjectKind.UpdateBundle, state, project, projectPath, projectIndex, config, buildOrder);
124773
+ return {
124774
+ kind: needsBuild(state, status, config) ?
124775
+ InvalidatedProjectKind.Build :
124776
+ InvalidatedProjectKind.UpdateBundle,
124777
+ status: status,
124778
+ project: project,
124779
+ projectPath: projectPath,
124780
+ projectIndex: projectIndex,
124781
+ config: config,
124782
+ };
124758
124783
  }
124759
124784
  return undefined;
124760
124785
  }
124786
+ function createInvalidatedProjectWithInfo(state, info, buildOrder) {
124787
+ verboseReportProjectStatus(state, info.project, info.status);
124788
+ return info.kind !== InvalidatedProjectKind.UpdateOutputFileStamps ?
124789
+ createBuildOrUpdateInvalidedProject(info.kind, state, info.project, info.projectPath, info.projectIndex, info.config, buildOrder) :
124790
+ createUpdateOutputFileStampsProject(state, info.project, info.projectPath, info.config, buildOrder);
124791
+ }
124792
+ function getNextInvalidatedProject(state, buildOrder, reportQueue) {
124793
+ var info = getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue);
124794
+ if (!info)
124795
+ return info;
124796
+ return createInvalidatedProjectWithInfo(state, info, buildOrder);
124797
+ }
124761
124798
  function listEmittedFile(_a, proj, file) {
124762
124799
  var write = _a.write;
124763
124800
  if (write && proj.options.listEmittedFiles) {
@@ -125198,9 +125235,9 @@ var ts;
125198
125235
  function invalidateProjectAndScheduleBuilds(state, resolvedPath, reloadLevel) {
125199
125236
  state.reportFileChangeDetected = true;
125200
125237
  invalidateProject(state, resolvedPath, reloadLevel);
125201
- scheduleBuildInvalidatedProject(state);
125238
+ scheduleBuildInvalidatedProject(state, 250, /*changeDetected*/ true);
125202
125239
  }
125203
- function scheduleBuildInvalidatedProject(state) {
125240
+ function scheduleBuildInvalidatedProject(state, time, changeDetected) {
125204
125241
  var hostWithWatch = state.hostWithWatch;
125205
125242
  if (!hostWithWatch.setTimeout || !hostWithWatch.clearTimeout) {
125206
125243
  return;
@@ -125208,25 +125245,38 @@ var ts;
125208
125245
  if (state.timerToBuildInvalidatedProject) {
125209
125246
  hostWithWatch.clearTimeout(state.timerToBuildInvalidatedProject);
125210
125247
  }
125211
- state.timerToBuildInvalidatedProject = hostWithWatch.setTimeout(buildNextInvalidatedProject, 250, state);
125248
+ state.timerToBuildInvalidatedProject = hostWithWatch.setTimeout(buildNextInvalidatedProject, time, state, changeDetected);
125212
125249
  }
125213
- function buildNextInvalidatedProject(state) {
125250
+ function buildNextInvalidatedProject(state, changeDetected) {
125214
125251
  state.timerToBuildInvalidatedProject = undefined;
125215
125252
  if (state.reportFileChangeDetected) {
125216
125253
  state.reportFileChangeDetected = false;
125217
125254
  state.projectErrorsReported.clear();
125218
125255
  reportWatchStatus(state, ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
125219
125256
  }
125257
+ var projectsBuilt = 0;
125220
125258
  var buildOrder = getBuildOrder(state);
125221
125259
  var invalidatedProject = getNextInvalidatedProject(state, buildOrder, /*reportQueue*/ false);
125222
125260
  if (invalidatedProject) {
125223
125261
  invalidatedProject.done();
125224
- if (state.projectPendingBuild.size) {
125225
- // Schedule next project for build
125226
- if (state.watch && !state.timerToBuildInvalidatedProject) {
125227
- scheduleBuildInvalidatedProject(state);
125262
+ projectsBuilt++;
125263
+ while (state.projectPendingBuild.size) {
125264
+ // If already scheduled, skip
125265
+ if (state.timerToBuildInvalidatedProject)
125266
+ return;
125267
+ // Before scheduling check if the next project needs build
125268
+ var info = getNextInvalidatedProjectCreateInfo(state, buildOrder, /*reportQueue*/ false);
125269
+ if (!info)
125270
+ break; // Nothing to build any more
125271
+ if (info.kind !== InvalidatedProjectKind.UpdateOutputFileStamps && (changeDetected || projectsBuilt === 5)) {
125272
+ // Schedule next project for build
125273
+ scheduleBuildInvalidatedProject(state, 100, /*changeDetected*/ false);
125274
+ return;
125228
125275
  }
125229
- return;
125276
+ var project = createInvalidatedProjectWithInfo(state, info, buildOrder);
125277
+ project.done();
125278
+ if (info.kind !== InvalidatedProjectKind.UpdateOutputFileStamps)
125279
+ projectsBuilt++;
125230
125280
  }
125231
125281
  }
125232
125282
  disableCache(state);
@@ -125330,8 +125380,6 @@ var ts;
125330
125380
  return getUpToDateStatus(state, parseConfigFile(state, configFileName, configFilePath), configFilePath);
125331
125381
  },
125332
125382
  invalidateProject: function (configFilePath, reloadLevel) { return invalidateProject(state, configFilePath, reloadLevel || ts.ConfigFileProgramReloadLevel.None); },
125333
- buildNextInvalidatedProject: function () { return buildNextInvalidatedProject(state); },
125334
- getAllParsedConfigs: function () { return ts.arrayFrom(ts.mapDefinedIterator(state.configFileCache.values(), function (config) { return isParsedCommandLine(config) ? config : undefined; })); },
125335
125383
  close: function () { return stopWatching(state); },
125336
125384
  };
125337
125385
  }
@@ -134667,6 +134715,7 @@ var ts;
134667
134715
  return kind === 131 /* AsyncKeyword */
134668
134716
  || kind === 132 /* AwaitKeyword */
134669
134717
  || kind === 127 /* AsKeyword */
134718
+ || kind === 152 /* TypeKeyword */
134670
134719
  || !ts.isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind);
134671
134720
  }
134672
134721
  function keywordForNode(node) {
@@ -143921,6 +143970,10 @@ var ts;
143921
143970
  }
143922
143971
  var typeDisplayString = printTypeInSingleLine(declarationType);
143923
143972
  if (typeDisplayString) {
143973
+ var isVariableNameMatchesType = preferences.includeInlayVariableTypeHintsWhenTypeMatchesName === false && ts.equateStringsCaseInsensitive(decl.name.getText(), typeDisplayString);
143974
+ if (isVariableNameMatchesType) {
143975
+ return;
143976
+ }
143924
143977
  addTypeHints(typeDisplayString, decl.name.end);
143925
143978
  }
143926
143979
  }
@@ -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;
@@ -9711,6 +9712,7 @@ declare namespace ts.server.protocol {
9711
9712
  readonly includeInlayParameterNameHintsWhenArgumentMatchesName?: boolean;
9712
9713
  readonly includeInlayFunctionParameterTypeHints?: boolean;
9713
9714
  readonly includeInlayVariableTypeHints?: boolean;
9715
+ readonly includeInlayVariableTypeHintsWhenTypeMatchesName?: boolean;
9714
9716
  readonly includeInlayPropertyDeclarationTypeHints?: boolean;
9715
9717
  readonly includeInlayFunctionLikeReturnTypeHints?: boolean;
9716
9718
  readonly includeInlayEnumMemberValueHints?: boolean;