typescript 5.6.0-dev.20240614 → 5.6.0-dev.20240616

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.
Files changed (3) hide show
  1. package/lib/tsc.js +107 -117
  2. package/lib/typescript.js +190 -151
  3. package/package.json +2 -2
package/lib/typescript.js CHANGED
@@ -2178,6 +2178,7 @@ __export(typescript_exports, {
2178
2178
  skipPartiallyEmittedExpressions: () => skipPartiallyEmittedExpressions,
2179
2179
  skipTrivia: () => skipTrivia,
2180
2180
  skipTypeChecking: () => skipTypeChecking,
2181
+ skipTypeCheckingIgnoringNoCheck: () => skipTypeCheckingIgnoringNoCheck,
2181
2182
  skipTypeParentheses: () => skipTypeParentheses,
2182
2183
  skipWhile: () => skipWhile,
2183
2184
  sliceAfter: () => sliceAfter,
@@ -2376,7 +2377,7 @@ module.exports = __toCommonJS(typescript_exports);
2376
2377
 
2377
2378
  // src/compiler/corePublic.ts
2378
2379
  var versionMajorMinor = "5.6";
2379
- var version = `${versionMajorMinor}.0-dev.20240614`;
2380
+ var version = `${versionMajorMinor}.0-dev.20240616`;
2380
2381
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2381
2382
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2382
2383
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -10750,8 +10751,6 @@ var Diagnostics = {
10750
10751
  Building_project_0: diag(6358, 3 /* Message */, "Building_project_0_6358", "Building project '{0}'..."),
10751
10752
  Updating_output_timestamps_of_project_0: diag(6359, 3 /* Message */, "Updating_output_timestamps_of_project_0_6359", "Updating output timestamps of project '{0}'..."),
10752
10753
  Project_0_is_up_to_date: diag(6361, 3 /* Message */, "Project_0_is_up_to_date_6361", "Project '{0}' is up to date"),
10753
- Skipping_build_of_project_0_because_its_dependency_1_has_errors: diag(6362, 3 /* Message */, "Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362", "Skipping build of project '{0}' because its dependency '{1}' has errors"),
10754
- Project_0_can_t_be_built_because_its_dependency_1_has_errors: diag(6363, 3 /* Message */, "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363", "Project '{0}' can't be built because its dependency '{1}' has errors"),
10755
10754
  Build_one_or_more_projects_and_their_dependencies_if_out_of_date: diag(6364, 3 /* Message */, "Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364", "Build one or more projects and their dependencies, if out of date"),
10756
10755
  Delete_the_outputs_of_all_projects: diag(6365, 3 /* Message */, "Delete_the_outputs_of_all_projects_6365", "Delete the outputs of all projects."),
10757
10756
  Show_what_would_be_built_or_deleted_if_specified_with_clean: diag(6367, 3 /* Message */, "Show_what_would_be_built_or_deleted_if_specified_with_clean_6367", "Show what would be built (or deleted, if specified with '--clean')"),
@@ -10763,8 +10762,6 @@ var Diagnostics = {
10763
10762
  Composite_projects_may_not_disable_incremental_compilation: diag(6379, 1 /* Error */, "Composite_projects_may_not_disable_incremental_compilation_6379", "Composite projects may not disable incremental compilation."),
10764
10763
  Specify_file_to_store_incremental_compilation_information: diag(6380, 3 /* Message */, "Specify_file_to_store_incremental_compilation_information_6380", "Specify file to store incremental compilation information"),
10765
10764
  Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2: diag(6381, 3 /* Message */, "Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381", "Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),
10766
- Skipping_build_of_project_0_because_its_dependency_1_was_not_built: diag(6382, 3 /* Message */, "Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382", "Skipping build of project '{0}' because its dependency '{1}' was not built"),
10767
- Project_0_can_t_be_built_because_its_dependency_1_was_not_built: diag(6383, 3 /* Message */, "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383", "Project '{0}' can't be built because its dependency '{1}' was not built"),
10768
10765
  Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6384, 3 /* Message */, "Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384", "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."),
10769
10766
  _0_is_deprecated: diag(
10770
10767
  6385,
@@ -22544,7 +22541,25 @@ function rangeOfTypeParameters(sourceFile, typeParameters) {
22544
22541
  return { pos, end };
22545
22542
  }
22546
22543
  function skipTypeChecking(sourceFile, options, host) {
22547
- return options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib || options.noCheck || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName) || !canIncludeBindAndCheckDiagnostics(sourceFile, options);
22544
+ return skipTypeCheckingWorker(
22545
+ sourceFile,
22546
+ options,
22547
+ host,
22548
+ /*ignoreNoCheck*/
22549
+ false
22550
+ );
22551
+ }
22552
+ function skipTypeCheckingIgnoringNoCheck(sourceFile, options, host) {
22553
+ return skipTypeCheckingWorker(
22554
+ sourceFile,
22555
+ options,
22556
+ host,
22557
+ /*ignoreNoCheck*/
22558
+ true
22559
+ );
22560
+ }
22561
+ function skipTypeCheckingWorker(sourceFile, options, host, ignoreNoCheck) {
22562
+ return options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib || !ignoreNoCheck && options.noCheck || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName) || !canIncludeBindAndCheckDiagnostics(sourceFile, options);
22548
22563
  }
22549
22564
  function canIncludeBindAndCheckDiagnostics(sourceFile, options) {
22550
22565
  if (!!sourceFile.checkJsDirective && sourceFile.checkJsDirective.enabled === false) return false;
@@ -40242,6 +40257,25 @@ var commonOptionsWithBuild = [
40242
40257
  description: Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,
40243
40258
  defaultValueDescription: false
40244
40259
  },
40260
+ {
40261
+ name: "noCheck",
40262
+ type: "boolean",
40263
+ showInSimplifiedHelpView: false,
40264
+ category: Diagnostics.Compiler_Diagnostics,
40265
+ description: Diagnostics.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported,
40266
+ transpileOptionValue: true,
40267
+ defaultValueDescription: false
40268
+ // Not setting affectsSemanticDiagnostics or affectsBuildInfo because we dont want all diagnostics to go away, its handled in builder
40269
+ },
40270
+ {
40271
+ name: "noEmit",
40272
+ type: "boolean",
40273
+ showInSimplifiedHelpView: true,
40274
+ category: Diagnostics.Emit,
40275
+ description: Diagnostics.Disable_emitting_files_from_a_compilation,
40276
+ transpileOptionValue: void 0,
40277
+ defaultValueDescription: false
40278
+ },
40245
40279
  {
40246
40280
  name: "assumeChangesOnlyAffectDirectDependencies",
40247
40281
  type: "boolean",
@@ -40506,29 +40540,6 @@ var commandOptionsWithoutBuild = [
40506
40540
  defaultValueDescription: false,
40507
40541
  description: Diagnostics.Disable_emitting_comments
40508
40542
  },
40509
- {
40510
- name: "noCheck",
40511
- type: "boolean",
40512
- showInSimplifiedHelpView: false,
40513
- category: Diagnostics.Compiler_Diagnostics,
40514
- description: Diagnostics.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported,
40515
- transpileOptionValue: true,
40516
- defaultValueDescription: false,
40517
- affectsSemanticDiagnostics: true,
40518
- affectsBuildInfo: true,
40519
- extraValidation() {
40520
- return [Diagnostics.Unknown_compiler_option_0, "noCheck"];
40521
- }
40522
- },
40523
- {
40524
- name: "noEmit",
40525
- type: "boolean",
40526
- showInSimplifiedHelpView: true,
40527
- category: Diagnostics.Emit,
40528
- description: Diagnostics.Disable_emitting_files_from_a_compilation,
40529
- transpileOptionValue: void 0,
40530
- defaultValueDescription: false
40531
- },
40532
40543
  {
40533
40544
  name: "importHelpers",
40534
40545
  type: "boolean",
@@ -56620,7 +56631,7 @@ function createTypeChecker(host) {
56620
56631
  }
56621
56632
  if (isJSDocTypeLiteral(node)) {
56622
56633
  return factory.createTypeLiteralNode(map(node.jsDocPropertyTags, (t) => {
56623
- const name = isIdentifier(t.name) ? t.name : t.name.right;
56634
+ const name = visitNode(isIdentifier(t.name) ? t.name : t.name.right, visitExistingNodeTreeSymbols, isIdentifier);
56624
56635
  const typeViaParent = getTypeOfPropertyOfType(getTypeFromTypeNode2(context, node), name.escapedText);
56625
56636
  const overrideTypeNode = typeViaParent && t.typeExpression && getTypeFromTypeNode2(context, t.typeExpression.type) !== typeViaParent ? typeToTypeNodeHelper(typeViaParent, context) : void 0;
56626
56637
  return factory.createPropertySignature(
@@ -56664,7 +56675,7 @@ function createTypeChecker(host) {
56664
56675
  void 0,
56665
56676
  getEffectiveDotDotDotForParameter(p),
56666
56677
  setTextRange2(context, factory.createIdentifier(getNameForJSDocFunctionParameter(p, i)), p),
56667
- p.questionToken,
56678
+ factory.cloneNode(p.questionToken),
56668
56679
  visitNode(p.type, visitExistingNodeTreeSymbols, isTypeNode),
56669
56680
  /*initializer*/
56670
56681
  void 0
@@ -56679,7 +56690,7 @@ function createTypeChecker(host) {
56679
56690
  void 0,
56680
56691
  getEffectiveDotDotDotForParameter(p),
56681
56692
  setTextRange2(context, factory.createIdentifier(getNameForJSDocFunctionParameter(p, i)), p),
56682
- p.questionToken,
56693
+ factory.cloneNode(p.questionToken),
56683
56694
  visitNode(p.type, visitExistingNodeTreeSymbols, isTypeNode),
56684
56695
  /*initializer*/
56685
56696
  void 0
@@ -56698,7 +56709,7 @@ function createTypeChecker(host) {
56698
56709
  if (isTypeParameterDeclaration(node)) {
56699
56710
  return factory.updateTypeParameterDeclaration(
56700
56711
  node,
56701
- node.modifiers,
56712
+ visitNodes2(node.modifiers, visitExistingNodeTreeSymbols, isModifier),
56702
56713
  setTextRange2(context, typeParameterToName(getDeclaredTypeOfSymbol(getSymbolOfDeclaration(node)), context), node),
56703
56714
  visitNode(node.constraint, visitExistingNodeTreeSymbols, isTypeNode),
56704
56715
  visitNode(node.default, visitExistingNodeTreeSymbols, isTypeNode)
@@ -56730,8 +56741,8 @@ function createTypeChecker(host) {
56730
56741
  return factory.updateImportTypeNode(
56731
56742
  node,
56732
56743
  factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
56733
- node.attributes,
56734
- node.qualifier,
56744
+ visitNode(node.attributes, visitExistingNodeTreeSymbols, isImportAttributes),
56745
+ visitNode(node.qualifier, visitExistingNodeTreeSymbols, isEntityName),
56735
56746
  visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
56736
56747
  node.isTypeOf
56737
56748
  );
@@ -56805,9 +56816,9 @@ function createTypeChecker(host) {
56805
56816
  hadError = hadError || introducesError;
56806
56817
  parameterName = result;
56807
56818
  } else {
56808
- parameterName = node.parameterName;
56819
+ parameterName = factory.cloneNode(node.parameterName);
56809
56820
  }
56810
- return factory.updateTypePredicateNode(node, node.assertsModifier, parameterName, visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode));
56821
+ return factory.updateTypePredicateNode(node, factory.cloneNode(node.assertsModifier), parameterName, visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode));
56811
56822
  }
56812
56823
  if (isTupleTypeNode(node) || isTypeLiteralNode(node) || isMappedTypeNode(node)) {
56813
56824
  const visited = visitEachChild2(node, visitExistingNodeTreeSymbols);
@@ -69543,7 +69554,7 @@ function createTypeChecker(host) {
69543
69554
  const sourceArity = getTypeReferenceArity(source2);
69544
69555
  const targetArity = getTypeReferenceArity(target2);
69545
69556
  const sourceRestFlag = isTupleType(source2) ? source2.target.combinedFlags & 4 /* Rest */ : 4 /* Rest */;
69546
- const targetRestFlag = target2.target.combinedFlags & 4 /* Rest */;
69557
+ const targetHasRestElement = !!(target2.target.combinedFlags & 12 /* Variable */);
69547
69558
  const sourceMinLength = isTupleType(source2) ? source2.target.minLength : 0;
69548
69559
  const targetMinLength = target2.target.minLength;
69549
69560
  if (!sourceRestFlag && sourceArity < targetMinLength) {
@@ -69552,13 +69563,13 @@ function createTypeChecker(host) {
69552
69563
  }
69553
69564
  return 0 /* False */;
69554
69565
  }
69555
- if (!targetRestFlag && targetArity < sourceMinLength) {
69566
+ if (!targetHasRestElement && targetArity < sourceMinLength) {
69556
69567
  if (reportErrors2) {
69557
69568
  reportError(Diagnostics.Source_has_0_element_s_but_target_allows_only_1, sourceMinLength, targetArity);
69558
69569
  }
69559
69570
  return 0 /* False */;
69560
69571
  }
69561
- if (!targetRestFlag && (sourceRestFlag || targetArity < sourceArity)) {
69572
+ if (!targetHasRestElement && (sourceRestFlag || targetArity < sourceArity)) {
69562
69573
  if (reportErrors2) {
69563
69574
  if (sourceMinLength < targetMinLength) {
69564
69575
  reportError(Diagnostics.Target_requires_0_element_s_but_source_may_have_fewer, targetMinLength);
@@ -69572,7 +69583,6 @@ function createTypeChecker(host) {
69572
69583
  const targetTypeArguments = getTypeArguments(target2);
69573
69584
  const targetStartCount = getStartElementCount(target2.target, 11 /* NonRest */);
69574
69585
  const targetEndCount = getEndElementCount(target2.target, 11 /* NonRest */);
69575
- const targetHasRestElement = target2.target.hasRestElement;
69576
69586
  let canExcludeDiscriminants = !!excludedProperties;
69577
69587
  for (let sourcePosition = 0; sourcePosition < sourceArity; sourcePosition++) {
69578
69588
  const sourceFlags = isTupleType(source2) ? source2.target.elementFlags[sourcePosition] : 4 /* Rest */;
@@ -70812,6 +70822,7 @@ function createTypeChecker(host) {
70812
70822
  return type;
70813
70823
  }
70814
70824
  function reportWideningErrorsInType(type) {
70825
+ var _a;
70815
70826
  let errorReported = false;
70816
70827
  if (getObjectFlags(type) & 65536 /* ContainsWideningType */) {
70817
70828
  if (type.flags & 1048576 /* Union */) {
@@ -70819,27 +70830,28 @@ function createTypeChecker(host) {
70819
70830
  errorReported = true;
70820
70831
  } else {
70821
70832
  for (const t of type.types) {
70822
- if (reportWideningErrorsInType(t)) {
70823
- errorReported = true;
70824
- }
70833
+ errorReported || (errorReported = reportWideningErrorsInType(t));
70825
70834
  }
70826
70835
  }
70827
- }
70828
- if (isArrayOrTupleType(type)) {
70836
+ } else if (isArrayOrTupleType(type)) {
70829
70837
  for (const t of getTypeArguments(type)) {
70830
- if (reportWideningErrorsInType(t)) {
70831
- errorReported = true;
70832
- }
70838
+ errorReported || (errorReported = reportWideningErrorsInType(t));
70833
70839
  }
70834
- }
70835
- if (isObjectLiteralType2(type)) {
70840
+ } else if (isObjectLiteralType2(type)) {
70836
70841
  for (const p of getPropertiesOfObjectType(type)) {
70837
70842
  const t = getTypeOfSymbol(p);
70838
70843
  if (getObjectFlags(t) & 65536 /* ContainsWideningType */) {
70839
- if (!reportWideningErrorsInType(t)) {
70840
- error2(p.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
70844
+ errorReported = reportWideningErrorsInType(t);
70845
+ if (!errorReported) {
70846
+ const valueDeclaration = (_a = p.declarations) == null ? void 0 : _a.find((d) => {
70847
+ var _a2;
70848
+ return ((_a2 = d.symbol.valueDeclaration) == null ? void 0 : _a2.parent) === type.symbol.valueDeclaration;
70849
+ });
70850
+ if (valueDeclaration) {
70851
+ error2(valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
70852
+ errorReported = true;
70853
+ }
70841
70854
  }
70842
- errorReported = true;
70843
70855
  }
70844
70856
  }
70845
70857
  }
@@ -127968,6 +127980,7 @@ function createBuilderProgramState(newProgram, oldState) {
127968
127980
  }
127969
127981
  state.changedFilesSet = /* @__PURE__ */ new Set();
127970
127982
  state.latestChangedDtsFile = compilerOptions.composite ? oldState == null ? void 0 : oldState.latestChangedDtsFile : void 0;
127983
+ state.checkPending = state.compilerOptions.noCheck ? true : void 0;
127971
127984
  const useOldState = BuilderState.canReuseOldState(state.referencedMap, oldState);
127972
127985
  const oldCompilerOptions = useOldState ? oldState.compilerOptions : void 0;
127973
127986
  let canCopySemanticDiagnostics = useOldState && !compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
@@ -128065,6 +128078,7 @@ function createBuilderProgramState(newProgram, oldState) {
128065
128078
  state.buildInfoEmitPending = true;
128066
128079
  }
128067
128080
  }
128081
+ if (useOldState && state.semanticDiagnosticsPerFile.size !== state.fileInfos.size && oldState.checkPending !== state.checkPending) state.buildInfoEmitPending = true;
128068
128082
  return state;
128069
128083
  function addFileToChangeSet(path) {
128070
128084
  state.changedFilesSet.add(path);
@@ -128248,7 +128262,7 @@ function removeDiagnosticsOfLibraryFiles(state) {
128248
128262
  if (!state.cleanedDiagnosticsOfLibFiles) {
128249
128263
  state.cleanedDiagnosticsOfLibFiles = true;
128250
128264
  const options = state.program.getCompilerOptions();
128251
- forEach(state.program.getSourceFiles(), (f) => state.program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, state.program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
128265
+ forEach(state.program.getSourceFiles(), (f) => state.program.isSourceFileDefaultLibrary(f) && !skipTypeCheckingIgnoringNoCheck(f, options, state.program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
128252
128266
  }
128253
128267
  }
128254
128268
  function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, host) {
@@ -128411,6 +128425,7 @@ function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, invalidateJsF
128411
128425
  return void 0;
128412
128426
  }
128413
128427
  function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) {
128428
+ if (state.compilerOptions.noCheck) return emptyArray;
128414
128429
  return concatenate(
128415
128430
  getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile),
128416
128431
  state.program.getProgramDiagnostics(sourceFile)
@@ -128477,6 +128492,7 @@ function getBuildInfo2(state) {
128477
128492
  const buildInfo2 = {
128478
128493
  root: arrayFrom(rootFileNames, (r) => relativeToBuildInfo(r)),
128479
128494
  errors: state.hasErrors ? true : void 0,
128495
+ checkPending: state.checkPending,
128480
128496
  version
128481
128497
  };
128482
128498
  return buildInfo2;
@@ -128507,6 +128523,7 @@ function getBuildInfo2(state) {
128507
128523
  ),
128508
128524
  // Actual value
128509
128525
  errors: state.hasErrors ? true : void 0,
128526
+ checkPending: state.checkPending,
128510
128527
  version
128511
128528
  };
128512
128529
  return buildInfo2;
@@ -128602,6 +128619,7 @@ function getBuildInfo2(state) {
128602
128619
  emitSignatures,
128603
128620
  latestChangedDtsFile,
128604
128621
  errors: state.hasErrors ? true : void 0,
128622
+ checkPending: state.checkPending,
128605
128623
  version
128606
128624
  };
128607
128625
  return buildInfo;
@@ -129067,8 +129085,13 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
129067
129085
  while (true) {
129068
129086
  const affected = getNextAffectedFile(state, cancellationToken, host);
129069
129087
  let result;
129070
- if (!affected) return void 0;
129071
- else if (affected !== state.program) {
129088
+ if (!affected) {
129089
+ if (state.checkPending && !state.compilerOptions.noCheck) {
129090
+ state.checkPending = void 0;
129091
+ state.buildInfoEmitPending = true;
129092
+ }
129093
+ return void 0;
129094
+ } else if (affected !== state.program) {
129072
129095
  const affectedSourceFile = affected;
129073
129096
  if (!ignoreSourceFile || !ignoreSourceFile(affectedSourceFile)) {
129074
129097
  result = getSemanticDiagnosticsOfFile(state, affectedSourceFile, cancellationToken);
@@ -129095,6 +129118,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
129095
129118
  result = diagnostics || emptyArray;
129096
129119
  state.changedFilesSet.clear();
129097
129120
  state.programEmitPending = getBuilderFileEmit(state.compilerOptions);
129121
+ if (!state.compilerOptions.noCheck) state.checkPending = void 0;
129098
129122
  state.buildInfoEmitPending = true;
129099
129123
  }
129100
129124
  return { result, affected };
@@ -129115,6 +129139,10 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
129115
129139
  for (const sourceFile2 of state.program.getSourceFiles()) {
129116
129140
  diagnostics = addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile2, cancellationToken));
129117
129141
  }
129142
+ if (state.checkPending && !state.compilerOptions.noCheck) {
129143
+ state.checkPending = void 0;
129144
+ state.buildInfoEmitPending = true;
129145
+ }
129118
129146
  return diagnostics || emptyArray;
129119
129147
  }
129120
129148
  }
@@ -129156,7 +129184,8 @@ function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath,
129156
129184
  latestChangedDtsFile,
129157
129185
  outSignature: buildInfo.outSignature,
129158
129186
  programEmitPending: buildInfo.pendingEmit === void 0 ? void 0 : toProgramEmitPending(buildInfo.pendingEmit, buildInfo.options),
129159
- hasErrors: buildInfo.errors
129187
+ hasErrors: buildInfo.errors,
129188
+ checkPending: buildInfo.checkPending
129160
129189
  };
129161
129190
  } else {
129162
129191
  filePathsSetList = (_b = buildInfo.fileIdsList) == null ? void 0 : _b.map((fileIds) => new Set(fileIds.map(toFilePath)));
@@ -129191,7 +129220,8 @@ function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath,
129191
129220
  affectedFilesPendingEmit: buildInfo.affectedFilesPendingEmit && arrayToMap(buildInfo.affectedFilesPendingEmit, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => toBuilderFileEmit(value, fullEmitForOptions)),
129192
129221
  latestChangedDtsFile,
129193
129222
  emitSignatures: (emitSignatures == null ? void 0 : emitSignatures.size) ? emitSignatures : void 0,
129194
- hasErrors: buildInfo.errors
129223
+ hasErrors: buildInfo.errors,
129224
+ checkPending: buildInfo.checkPending
129195
129225
  };
129196
129226
  }
129197
129227
  return {
@@ -131858,12 +131888,11 @@ var UpToDateStatusType = /* @__PURE__ */ ((UpToDateStatusType2) => {
131858
131888
  UpToDateStatusType2[UpToDateStatusType2["OutOfDateOptions"] = 9] = "OutOfDateOptions";
131859
131889
  UpToDateStatusType2[UpToDateStatusType2["OutOfDateRoots"] = 10] = "OutOfDateRoots";
131860
131890
  UpToDateStatusType2[UpToDateStatusType2["UpstreamOutOfDate"] = 11] = "UpstreamOutOfDate";
131861
- UpToDateStatusType2[UpToDateStatusType2["UpstreamBlocked"] = 12] = "UpstreamBlocked";
131862
- UpToDateStatusType2[UpToDateStatusType2["ComputingUpstream"] = 13] = "ComputingUpstream";
131863
- UpToDateStatusType2[UpToDateStatusType2["TsVersionOutputOfDate"] = 14] = "TsVersionOutputOfDate";
131864
- UpToDateStatusType2[UpToDateStatusType2["UpToDateWithInputFileText"] = 15] = "UpToDateWithInputFileText";
131865
- UpToDateStatusType2[UpToDateStatusType2["ContainerOnly"] = 16] = "ContainerOnly";
131866
- UpToDateStatusType2[UpToDateStatusType2["ForceBuild"] = 17] = "ForceBuild";
131891
+ UpToDateStatusType2[UpToDateStatusType2["ComputingUpstream"] = 12] = "ComputingUpstream";
131892
+ UpToDateStatusType2[UpToDateStatusType2["TsVersionOutputOfDate"] = 13] = "TsVersionOutputOfDate";
131893
+ UpToDateStatusType2[UpToDateStatusType2["UpToDateWithInputFileText"] = 14] = "UpToDateWithInputFileText";
131894
+ UpToDateStatusType2[UpToDateStatusType2["ContainerOnly"] = 15] = "ContainerOnly";
131895
+ UpToDateStatusType2[UpToDateStatusType2["ForceBuild"] = 16] = "ForceBuild";
131867
131896
  return UpToDateStatusType2;
131868
131897
  })(UpToDateStatusType || {});
131869
131898
  function resolveConfigFileProjectName(project) {
@@ -132502,17 +132531,17 @@ function createBuildOrUpdateInvalidedProject(state, project, projectPath, projec
132502
132531
  updateOutputTimestampsWorker(state, config, projectPath, Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
132503
132532
  }
132504
132533
  state.projectErrorsReported.set(projectPath, true);
132534
+ buildResult = ((_c = program.hasChangedEmitSignature) == null ? void 0 : _c.call(program)) ? 0 /* None */ : 2 /* DeclarationOutputUnchanged */;
132505
132535
  if (!diagnostics.length) {
132506
132536
  state.diagnostics.delete(projectPath);
132507
132537
  state.projectStatus.set(projectPath, {
132508
132538
  type: 1 /* UpToDate */,
132509
132539
  oldestOutputFileName: firstOrUndefinedIterator(emittedOutputs.values()) ?? getFirstProjectOutput(config, !host.useCaseSensitiveFileNames())
132510
132540
  });
132511
- buildResult = ((_c = program.hasChangedEmitSignature) == null ? void 0 : _c.call(program)) ? 0 /* None */ : 2 /* DeclarationOutputUnchanged */;
132512
132541
  } else {
132513
132542
  state.diagnostics.set(projectPath, diagnostics);
132514
132543
  state.projectStatus.set(projectPath, { type: 0 /* Unbuildable */, reason: `it had errors` });
132515
- buildResult = 4 /* AnyErrors */;
132544
+ buildResult |= 4 /* AnyErrors */;
132516
132545
  }
132517
132546
  afterProgramDone(state, program);
132518
132547
  step = 2 /* QueueReferencingProjects */;
@@ -132582,7 +132611,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
132582
132611
  }
132583
132612
  continue;
132584
132613
  }
132585
- if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 15 /* UpToDateWithInputFileText */) {
132614
+ if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 14 /* UpToDateWithInputFileText */) {
132586
132615
  reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
132587
132616
  return {
132588
132617
  kind: 1 /* UpdateOutputFileStamps */,
@@ -132594,21 +132623,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
132594
132623
  };
132595
132624
  }
132596
132625
  }
132597
- if (status.type === 12 /* UpstreamBlocked */) {
132598
- verboseReportProjectStatus(state, project, status);
132599
- reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
132600
- projectPendingBuild.delete(projectPath);
132601
- if (options.verbose) {
132602
- reportStatus(
132603
- state,
132604
- status.upstreamProjectBlocked ? Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_was_not_built : Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_has_errors,
132605
- project,
132606
- status.upstreamProjectName
132607
- );
132608
- }
132609
- continue;
132610
- }
132611
- if (status.type === 16 /* ContainerOnly */) {
132626
+ if (status.type === 15 /* ContainerOnly */) {
132612
132627
  verboseReportProjectStatus(state, project, status);
132613
132628
  reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
132614
132629
  projectPendingBuild.delete(projectPath);
@@ -132750,38 +132765,25 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
132750
132765
  var _a, _b, _c;
132751
132766
  if (!project.fileNames.length && !canJsonReportNoInputFiles(project.raw)) {
132752
132767
  return {
132753
- type: 16 /* ContainerOnly */
132768
+ type: 15 /* ContainerOnly */
132754
132769
  };
132755
132770
  }
132756
132771
  let referenceStatuses;
132757
132772
  const force = !!state.options.force;
132758
132773
  if (project.projectReferences) {
132759
- state.projectStatus.set(resolvedPath, { type: 13 /* ComputingUpstream */ });
132774
+ state.projectStatus.set(resolvedPath, { type: 12 /* ComputingUpstream */ });
132760
132775
  for (const ref of project.projectReferences) {
132761
132776
  const resolvedRef = resolveProjectReferencePath(ref);
132762
132777
  const resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);
132763
132778
  const resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath);
132764
132779
  const refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath);
132765
- if (refStatus.type === 13 /* ComputingUpstream */ || refStatus.type === 16 /* ContainerOnly */) {
132780
+ if (refStatus.type === 12 /* ComputingUpstream */ || refStatus.type === 15 /* ContainerOnly */) {
132766
132781
  continue;
132767
132782
  }
132768
- if (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 12 /* UpstreamBlocked */) {
132769
- return {
132770
- type: 12 /* UpstreamBlocked */,
132771
- upstreamProjectName: ref.path,
132772
- upstreamProjectBlocked: refStatus.type === 12 /* UpstreamBlocked */
132773
- };
132774
- }
132775
- if (refStatus.type !== 1 /* UpToDate */) {
132776
- return {
132777
- type: 11 /* UpstreamOutOfDate */,
132778
- upstreamProjectName: ref.path
132779
- };
132780
- }
132781
132783
  if (!force) (referenceStatuses || (referenceStatuses = [])).push({ ref, refStatus, resolvedRefPath, resolvedConfig });
132782
132784
  }
132783
132785
  }
132784
- if (force) return { type: 17 /* ForceBuild */ };
132786
+ if (force) return { type: 16 /* ForceBuild */ };
132785
132787
  const { host } = state;
132786
132788
  const buildInfoPath = getTsBuildInfoEmitOutputFilePath(project.options);
132787
132789
  const isIncremental = isIncrementalCompilation(project.options);
@@ -132810,18 +132812,19 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
132810
132812
  const incrementalBuildInfo = isIncremental && isIncrementalBuildInfo(buildInfo) ? buildInfo : void 0;
132811
132813
  if ((incrementalBuildInfo || !isIncremental) && buildInfo.version !== version) {
132812
132814
  return {
132813
- type: 14 /* TsVersionOutputOfDate */,
132815
+ type: 13 /* TsVersionOutputOfDate */,
132814
132816
  version: buildInfo.version
132815
132817
  };
132816
132818
  }
132817
- if (buildInfo.errors) {
132819
+ if (!project.options.noCheck && (buildInfo.errors || // TODO: syntax errors????
132820
+ buildInfo.checkPending)) {
132818
132821
  return {
132819
132822
  type: 8 /* OutOfDateBuildInfoWithErrors */,
132820
132823
  buildInfoFile: buildInfoPath
132821
132824
  };
132822
132825
  }
132823
132826
  if (incrementalBuildInfo) {
132824
- if (((_a = incrementalBuildInfo.semanticDiagnosticsPerFile) == null ? void 0 : _a.length) || !project.options.noEmit && getEmitDeclarations(project.options) && ((_b = incrementalBuildInfo.emitDiagnosticsPerFile) == null ? void 0 : _b.length)) {
132827
+ if (!project.options.noCheck && (((_a = incrementalBuildInfo.semanticDiagnosticsPerFile) == null ? void 0 : _a.length) || !project.options.noEmit && getEmitDeclarations(project.options) && ((_b = incrementalBuildInfo.emitDiagnosticsPerFile) == null ? void 0 : _b.length))) {
132825
132828
  return {
132826
132829
  type: 8 /* OutOfDateBuildInfoWithErrors */,
132827
132830
  buildInfoFile: buildInfoPath
@@ -132969,7 +132972,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
132969
132972
  );
132970
132973
  if (dependentPackageFileStatus) return dependentPackageFileStatus;
132971
132974
  return {
132972
- type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 15 /* UpToDateWithInputFileText */ : 1 /* UpToDate */,
132975
+ type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 14 /* UpToDateWithInputFileText */ : 1 /* UpToDate */,
132973
132976
  newestInputFileTime,
132974
132977
  newestInputFileName,
132975
132978
  oldestOutputFileName
@@ -133052,7 +133055,6 @@ function updateOutputTimestamps(state, proj, resolvedPath) {
133052
133055
  });
133053
133056
  }
133054
133057
  function queueReferencingProjects(state, project, projectPath, projectIndex, config, buildOrder, buildResult) {
133055
- if (buildResult & 4 /* AnyErrors */) return;
133056
133058
  if (!config.options.composite) return;
133057
133059
  for (let index = projectIndex + 1; index < buildOrder.length; index++) {
133058
133060
  const nextProject = buildOrder[index];
@@ -133071,7 +133073,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
133071
133073
  status.type = 2 /* UpToDateWithUpstreamTypes */;
133072
133074
  break;
133073
133075
  }
133074
- case 15 /* UpToDateWithInputFileText */:
133076
+ case 14 /* UpToDateWithInputFileText */:
133075
133077
  case 2 /* UpToDateWithUpstreamTypes */:
133076
133078
  if (!(buildResult & 2 /* DeclarationOutputUnchanged */)) {
133077
133079
  state.projectStatus.set(nextProjectPath, {
@@ -133081,11 +133083,6 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
133081
133083
  });
133082
133084
  }
133083
133085
  break;
133084
- case 12 /* UpstreamBlocked */:
133085
- if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) {
133086
- clearProjectStatus(state, nextProjectPath);
133087
- }
133088
- break;
133089
133086
  }
133090
133087
  }
133091
133088
  addProjToQueue(state, nextProjectPath, 0 /* Update */);
@@ -133546,7 +133543,7 @@ function reportUpToDateStatus(state, configFileName, status) {
133546
133543
  Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies,
133547
133544
  relName(state, configFileName)
133548
133545
  );
133549
- case 15 /* UpToDateWithInputFileText */:
133546
+ case 14 /* UpToDateWithInputFileText */:
133550
133547
  return reportStatus(
133551
133548
  state,
133552
133549
  Diagnostics.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files,
@@ -133559,13 +133556,6 @@ function reportUpToDateStatus(state, configFileName, status) {
133559
133556
  relName(state, configFileName),
133560
133557
  relName(state, status.upstreamProjectName)
133561
133558
  );
133562
- case 12 /* UpstreamBlocked */:
133563
- return reportStatus(
133564
- state,
133565
- status.upstreamProjectBlocked ? Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors,
133566
- relName(state, configFileName),
133567
- relName(state, status.upstreamProjectName)
133568
- );
133569
133559
  case 0 /* Unbuildable */:
133570
133560
  return reportStatus(
133571
133561
  state,
@@ -133573,7 +133563,7 @@ function reportUpToDateStatus(state, configFileName, status) {
133573
133563
  relName(state, configFileName),
133574
133564
  status.reason
133575
133565
  );
133576
- case 14 /* TsVersionOutputOfDate */:
133566
+ case 13 /* TsVersionOutputOfDate */:
133577
133567
  return reportStatus(
133578
133568
  state,
133579
133569
  Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,
@@ -133581,14 +133571,14 @@ function reportUpToDateStatus(state, configFileName, status) {
133581
133571
  status.version,
133582
133572
  version
133583
133573
  );
133584
- case 17 /* ForceBuild */:
133574
+ case 16 /* ForceBuild */:
133585
133575
  return reportStatus(
133586
133576
  state,
133587
133577
  Diagnostics.Project_0_is_being_forcibly_rebuilt,
133588
133578
  relName(state, configFileName)
133589
133579
  );
133590
- case 16 /* ContainerOnly */:
133591
- case 13 /* ComputingUpstream */:
133580
+ case 15 /* ContainerOnly */:
133581
+ case 12 /* ComputingUpstream */:
133592
133582
  break;
133593
133583
  default:
133594
133584
  assertType(status);
@@ -173192,9 +173182,6 @@ function getArgumentOrParameterListInfo(node, position, sourceFile, checker) {
173192
173182
  if (!info) return void 0;
173193
173183
  const { list, argumentIndex } = info;
173194
173184
  const argumentCount = getArgumentCount(checker, list);
173195
- if (argumentIndex !== 0) {
173196
- Debug.assertLessThan(argumentIndex, argumentCount);
173197
- }
173198
173185
  const argumentsSpan = getApplicableSpanForArguments(list, sourceFile);
173199
173186
  return { list, argumentIndex, argumentCount, argumentsSpan };
173200
173187
  }
@@ -173467,9 +173454,6 @@ function createSignatureHelpItems(candidates, resolvedSignature, { isTypeParamet
173467
173454
  void 0
173468
173455
  ) : emptyArray;
173469
173456
  const items = map(candidates, (candidateSignature) => getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, typeChecker, enclosingDeclaration, sourceFile));
173470
- if (argumentIndex !== 0) {
173471
- Debug.assertLessThan(argumentIndex, argumentCount);
173472
- }
173473
173457
  let selectedItemIndex = 0;
173474
173458
  let itemsSeen = 0;
173475
173459
  for (let i = 0; i < items.length; i++) {
@@ -180741,6 +180725,7 @@ __export(ts_exports2, {
180741
180725
  skipPartiallyEmittedExpressions: () => skipPartiallyEmittedExpressions,
180742
180726
  skipTrivia: () => skipTrivia,
180743
180727
  skipTypeChecking: () => skipTypeChecking,
180728
+ skipTypeCheckingIgnoringNoCheck: () => skipTypeCheckingIgnoringNoCheck,
180744
180729
  skipTypeParentheses: () => skipTypeParentheses,
180745
180730
  skipWhile: () => skipWhile,
180746
180731
  sliceAfter: () => sliceAfter,
@@ -185059,8 +185044,23 @@ function findProjectByName(projectName, projects) {
185059
185044
  }
185060
185045
  var noopConfigFileWatcher = { close: noop };
185061
185046
  function getConfigFileNameFromCache(info, cache) {
185062
- if (!cache || isAncestorConfigFileInfo(info)) return void 0;
185063
- return cache.get(info.path);
185047
+ if (!cache) return void 0;
185048
+ const configFileForOpenFile = cache.get(info.path);
185049
+ if (configFileForOpenFile === void 0) return void 0;
185050
+ if (!isAncestorConfigFileInfo(info)) {
185051
+ return isString(configFileForOpenFile) || !configFileForOpenFile ? configFileForOpenFile : (
185052
+ // direct result
185053
+ configFileForOpenFile.get(
185054
+ /*key*/
185055
+ false
185056
+ )
185057
+ );
185058
+ } else {
185059
+ return configFileForOpenFile && !isString(configFileForOpenFile) ? (
185060
+ // Map with fileName as key
185061
+ configFileForOpenFile.get(info.fileName)
185062
+ ) : void 0;
185063
+ }
185064
185064
  }
185065
185065
  function isOpenScriptInfo(infoOrFileNameOrConfig) {
185066
185066
  return !!infoOrFileNameOrConfig.containingProjects;
@@ -185074,13 +185074,17 @@ var ConfiguredProjectLoadKind = /* @__PURE__ */ ((ConfiguredProjectLoadKind2) =>
185074
185074
  ConfiguredProjectLoadKind2[ConfiguredProjectLoadKind2["Reload"] = 2] = "Reload";
185075
185075
  return ConfiguredProjectLoadKind2;
185076
185076
  })(ConfiguredProjectLoadKind || {});
185077
- function forEachAncestorProject(info, project, cb, kind, reason, allowDeferredClosed, reloadedProjects, delayReloadedConfiguredProjects) {
185077
+ function forEachAncestorProject(info, project, cb, kind, reason, allowDeferredClosed, reloadedProjects, searchOnlyPotentialSolution, delayReloadedConfiguredProjects) {
185078
185078
  while (true) {
185079
- if (!project.isInitialLoadPending() && (!project.getCompilerOptions().composite || project.getCompilerOptions().disableSolutionSearching)) return;
185079
+ if (!project.isInitialLoadPending() && (searchOnlyPotentialSolution && !project.getCompilerOptions().composite || // Currently disableSolutionSearching is shared for finding solution/project when
185080
+ // - loading solution for find all references
185081
+ // - trying to find default project
185082
+ project.getCompilerOptions().disableSolutionSearching)) return;
185080
185083
  const configFileName = project.projectService.getConfigFileNameForFile({
185081
185084
  fileName: project.getConfigFilePath(),
185082
185085
  path: info.path,
185083
- configFileInfo: true
185086
+ configFileInfo: true,
185087
+ isForDefaultProject: !searchOnlyPotentialSolution
185084
185088
  }, kind === 0 /* Find */);
185085
185089
  if (!configFileName) return;
185086
185090
  const ancestor = project.projectService.findCreateOrReloadConfiguredProject(
@@ -185088,11 +185092,11 @@ function forEachAncestorProject(info, project, cb, kind, reason, allowDeferredCl
185088
185092
  kind,
185089
185093
  reason,
185090
185094
  allowDeferredClosed,
185091
- /*triggerFile*/
185092
- void 0,
185095
+ !searchOnlyPotentialSolution ? info.fileName : void 0,
185096
+ // Config Diag event for project if its for default project
185093
185097
  reloadedProjects,
185094
- /*delayLoad*/
185095
- true,
185098
+ searchOnlyPotentialSolution,
185099
+ // Delay load if we are searching for solution
185096
185100
  delayReloadedConfiguredProjects
185097
185101
  );
185098
185102
  if (!ancestor) return;
@@ -186193,7 +186197,7 @@ var _ProjectService = class _ProjectService {
186193
186197
  configFileExists(configFileName, canonicalConfigFilePath, info) {
186194
186198
  const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath);
186195
186199
  let openFilesImpactedByConfigFile;
186196
- if (this.openFiles.has(info.path) && !isAncestorConfigFileInfo(info)) {
186200
+ if (this.openFiles.has(info.path) && (!isAncestorConfigFileInfo(info) || info.isForDefaultProject)) {
186197
186201
  if (configFileExistenceInfo) (configFileExistenceInfo.openFilesImpactedByConfigFile ?? (configFileExistenceInfo.openFilesImpactedByConfigFile = /* @__PURE__ */ new Set())).add(info.path);
186198
186202
  else (openFilesImpactedByConfigFile = /* @__PURE__ */ new Set()).add(info.path);
186199
186203
  }
@@ -186321,24 +186325,31 @@ var _ProjectService = class _ProjectService {
186321
186325
  let searchPath = asNormalizedPath(getDirectoryPath(info.fileName));
186322
186326
  const isSearchPathInProjectRoot = () => containsPath(projectRootPath, searchPath, this.currentDirectory, !this.host.useCaseSensitiveFileNames);
186323
186327
  const anySearchPathOk = !projectRootPath || !isSearchPathInProjectRoot();
186324
- let searchInDirectory = !isAncestorConfigFileInfo(info);
186328
+ let searchTsconfig = true;
186329
+ let searchJsconfig = true;
186330
+ if (isAncestorConfigFileInfo(info)) {
186331
+ if (endsWith(info.fileName, "tsconfig.json")) searchTsconfig = false;
186332
+ else searchTsconfig = searchJsconfig = false;
186333
+ }
186325
186334
  do {
186326
- if (searchInDirectory) {
186327
- const canonicalSearchPath = normalizedPathToPath(searchPath, this.currentDirectory, this.toCanonicalFileName);
186335
+ const canonicalSearchPath = normalizedPathToPath(searchPath, this.currentDirectory, this.toCanonicalFileName);
186336
+ if (searchTsconfig) {
186328
186337
  const tsconfigFileName = asNormalizedPath(combinePaths(searchPath, "tsconfig.json"));
186329
- let result = action(combinePaths(canonicalSearchPath, "tsconfig.json"), tsconfigFileName);
186338
+ const result = action(combinePaths(canonicalSearchPath, "tsconfig.json"), tsconfigFileName);
186330
186339
  if (result) return tsconfigFileName;
186340
+ }
186341
+ if (searchJsconfig) {
186331
186342
  const jsconfigFileName = asNormalizedPath(combinePaths(searchPath, "jsconfig.json"));
186332
- result = action(combinePaths(canonicalSearchPath, "jsconfig.json"), jsconfigFileName);
186343
+ const result = action(combinePaths(canonicalSearchPath, "jsconfig.json"), jsconfigFileName);
186333
186344
  if (result) return jsconfigFileName;
186334
- if (isNodeModulesDirectory(canonicalSearchPath)) {
186335
- break;
186336
- }
186345
+ }
186346
+ if (isNodeModulesDirectory(canonicalSearchPath)) {
186347
+ break;
186337
186348
  }
186338
186349
  const parentPath = asNormalizedPath(getDirectoryPath(searchPath));
186339
186350
  if (parentPath === searchPath) break;
186340
186351
  searchPath = parentPath;
186341
- searchInDirectory = true;
186352
+ searchTsconfig = searchJsconfig = true;
186342
186353
  } while (anySearchPathOk || isSearchPathInProjectRoot());
186343
186354
  return void 0;
186344
186355
  }
@@ -186361,8 +186372,19 @@ var _ProjectService = class _ProjectService {
186361
186372
  /** Caches the configFilename for script info or ancestor of open script info */
186362
186373
  setConfigFileNameForFileInCache(info, configFileName) {
186363
186374
  if (!this.openFiles.has(info.path)) return;
186364
- if (isAncestorConfigFileInfo(info)) return;
186365
- this.configFileForOpenFiles.set(info.path, configFileName || false);
186375
+ const config = configFileName || false;
186376
+ if (!isAncestorConfigFileInfo(info)) {
186377
+ this.configFileForOpenFiles.set(info.path, config);
186378
+ } else {
186379
+ let configFileForOpenFile = this.configFileForOpenFiles.get(info.path);
186380
+ if (!configFileForOpenFile || isString(configFileForOpenFile)) {
186381
+ this.configFileForOpenFiles.set(
186382
+ info.path,
186383
+ configFileForOpenFile = (/* @__PURE__ */ new Map()).set(false, configFileForOpenFile)
186384
+ );
186385
+ }
186386
+ configFileForOpenFile.set(info.fileName, config);
186387
+ }
186366
186388
  }
186367
186389
  /**
186368
186390
  * This function tries to search for a tsconfig.json for the given file.
@@ -187739,7 +187761,7 @@ Dynamic files must always be opened with service's current directory or service
187739
187761
  seenProjects
187740
187762
  };
187741
187763
  function tryFindDefaultConfiguredProject(project) {
187742
- return isDefaultProject(project) ? defaultProject : tryFindDefaultConfiguredProjectFromReferences(project);
187764
+ return isDefaultProject(project) ? defaultProject : tryFindDefaultConfiguredProjectFromReferences(project) ?? tryFindDefaultConfiguredProjectFromAncestor(project);
187743
187765
  }
187744
187766
  function isDefaultProject(project) {
187745
187767
  if (!tryAddToSet(seenProjects, project)) return;
@@ -187762,6 +187784,20 @@ Dynamic files must always be opened with service's current directory or service
187762
187784
  reloadedProjects
187763
187785
  );
187764
187786
  }
187787
+ function tryFindDefaultConfiguredProjectFromAncestor(project) {
187788
+ return forEachAncestorProject(
187789
+ // If not in referenced projects, try ancestors and its references
187790
+ info,
187791
+ project,
187792
+ tryFindDefaultConfiguredProject,
187793
+ kind,
187794
+ `Creating possible configured project for ${info.fileName} to open`,
187795
+ allowDeferredClosed,
187796
+ reloadedProjects,
187797
+ /*searchOnlyPotentialSolution*/
187798
+ false
187799
+ );
187800
+ }
187765
187801
  }
187766
187802
  tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo(info, kind, reloadedProjects, delayReloadedConfiguredProjects) {
187767
187803
  const allowDeferredClosed = kind === 0 /* Find */;
@@ -187784,6 +187820,8 @@ Dynamic files must always be opened with service's current directory or service
187784
187820
  `Creating project possibly referencing default composite project ${defaultProject.getProjectName()} of open file ${info.fileName}`,
187785
187821
  allowDeferredClosed,
187786
187822
  reloadedProjects,
187823
+ /*searchOnlyPotentialSolution*/
187824
+ true,
187787
187825
  delayReloadedConfiguredProjects
187788
187826
  );
187789
187827
  }
@@ -195222,6 +195260,7 @@ if (typeof console !== "undefined") {
195222
195260
  skipPartiallyEmittedExpressions,
195223
195261
  skipTrivia,
195224
195262
  skipTypeChecking,
195263
+ skipTypeCheckingIgnoringNoCheck,
195225
195264
  skipTypeParentheses,
195226
195265
  skipWhile,
195227
195266
  sliceAfter,