typescript 5.4.0-dev.20240201 → 5.4.0-dev.20240203

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/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.4";
21
- var version = `${versionMajorMinor}.0-dev.20240201`;
21
+ var version = `${versionMajorMinor}.0-dev.20240203`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -6923,7 +6923,6 @@ var Diagnostics = {
6923
6923
  Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, 3 /* Message */, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."),
6924
6924
  Specify_library_files_to_be_included_in_the_compilation: diag(6079, 3 /* Message */, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."),
6925
6925
  Specify_JSX_code_generation: diag(6080, 3 /* Message */, "Specify_JSX_code_generation_6080", "Specify JSX code generation."),
6926
- File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, 3 /* Message */, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."),
6927
6926
  Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, 1 /* Error */, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."),
6928
6927
  Base_directory_to_resolve_non_absolute_module_names: diag(6083, 3 /* Message */, "Base_directory_to_resolve_non_absolute_module_names_6083", "Base directory to resolve non-absolute module names."),
6929
6928
  Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: diag(6084, 3 /* Message */, "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),
@@ -38721,15 +38720,9 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
38721
38720
  }
38722
38721
  }
38723
38722
  const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
38724
- const fromFile = tryFile(candidate2, onlyRecordFailures2, state2);
38723
+ const fromFile = loadFileNameFromPackageJsonField(extensions2, candidate2, onlyRecordFailures2, state2);
38725
38724
  if (fromFile) {
38726
- const resolved = resolvedIfExtensionMatches(extensions2, fromFile);
38727
- if (resolved) {
38728
- return noPackageId(resolved);
38729
- }
38730
- if (state2.traceEnabled) {
38731
- trace(state2.host, Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile);
38732
- }
38725
+ return noPackageId(fromFile);
38733
38726
  }
38734
38727
  const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
38735
38728
  const features = state2.features;
@@ -38785,10 +38778,6 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
38785
38778
  return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state);
38786
38779
  }
38787
38780
  }
38788
- function resolvedIfExtensionMatches(extensions, path, resolvedUsingTsExtension) {
38789
- const ext = tryGetExtensionFromPath2(path);
38790
- return ext !== void 0 && extensionIsOk(extensions, ext) ? { path, ext, resolvedUsingTsExtension } : void 0;
38791
- }
38792
38781
  function extensionIsOk(extensions, extension) {
38793
38782
  return extensions & 2 /* JavaScript */ && (extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */) || extensions & 1 /* TypeScript */ && (extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */) || extensions & 4 /* Declaration */ && (extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */) || extensions & 8 /* Json */ && extension === ".json" /* Json */ || false;
38794
38783
  }
package/lib/tsserver.js CHANGED
@@ -2340,7 +2340,7 @@ module.exports = __toCommonJS(server_exports);
2340
2340
 
2341
2341
  // src/compiler/corePublic.ts
2342
2342
  var versionMajorMinor = "5.4";
2343
- var version = `${versionMajorMinor}.0-dev.20240201`;
2343
+ var version = `${versionMajorMinor}.0-dev.20240203`;
2344
2344
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2345
2345
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2346
2346
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -10490,7 +10490,6 @@ var Diagnostics = {
10490
10490
  Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, 3 /* Message */, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."),
10491
10491
  Specify_library_files_to_be_included_in_the_compilation: diag(6079, 3 /* Message */, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."),
10492
10492
  Specify_JSX_code_generation: diag(6080, 3 /* Message */, "Specify_JSX_code_generation_6080", "Specify JSX code generation."),
10493
- File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, 3 /* Message */, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."),
10494
10493
  Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, 1 /* Error */, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."),
10495
10494
  Base_directory_to_resolve_non_absolute_module_names: diag(6083, 3 /* Message */, "Base_directory_to_resolve_non_absolute_module_names_6083", "Base directory to resolve non-absolute module names."),
10496
10495
  Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: diag(6084, 3 /* Message */, "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),
@@ -43393,15 +43392,9 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
43393
43392
  }
43394
43393
  }
43395
43394
  const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
43396
- const fromFile = tryFile(candidate2, onlyRecordFailures2, state2);
43395
+ const fromFile = loadFileNameFromPackageJsonField(extensions2, candidate2, onlyRecordFailures2, state2);
43397
43396
  if (fromFile) {
43398
- const resolved = resolvedIfExtensionMatches(extensions2, fromFile);
43399
- if (resolved) {
43400
- return noPackageId(resolved);
43401
- }
43402
- if (state2.traceEnabled) {
43403
- trace(state2.host, Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile);
43404
- }
43397
+ return noPackageId(fromFile);
43405
43398
  }
43406
43399
  const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
43407
43400
  const features = state2.features;
@@ -43457,10 +43450,6 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
43457
43450
  return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state);
43458
43451
  }
43459
43452
  }
43460
- function resolvedIfExtensionMatches(extensions, path, resolvedUsingTsExtension) {
43461
- const ext = tryGetExtensionFromPath2(path);
43462
- return ext !== void 0 && extensionIsOk(extensions, ext) ? { path, ext, resolvedUsingTsExtension } : void 0;
43463
- }
43464
43453
  function extensionIsOk(extensions, extension) {
43465
43454
  return extensions & 2 /* JavaScript */ && (extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */) || extensions & 1 /* TypeScript */ && (extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */) || extensions & 4 /* Declaration */ && (extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */) || extensions & 8 /* Json */ && extension === ".json" /* Json */ || false;
43466
43455
  }
@@ -167905,84 +167894,98 @@ function coalesceImportsWorker(importGroup, comparer, sourceFile, preferences) {
167905
167894
  if (importGroup.length === 0) {
167906
167895
  return importGroup;
167907
167896
  }
167908
- const { importWithoutClause, typeOnlyImports, regularImports } = getCategorizedImports(importGroup);
167909
- const coalescedImports = [];
167910
- if (importWithoutClause) {
167911
- coalescedImports.push(importWithoutClause);
167912
- }
167913
- for (const group2 of [regularImports, typeOnlyImports]) {
167914
- const isTypeOnly = group2 === typeOnlyImports;
167915
- const { defaultImports, namespaceImports, namedImports } = group2;
167916
- if (!isTypeOnly && defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) {
167917
- const defaultImport = defaultImports[0];
167918
- coalescedImports.push(
167919
- updateImportDeclarationAndClause(defaultImport, defaultImport.importClause.name, namespaceImports[0].importClause.namedBindings)
167920
- );
167921
- continue;
167922
- }
167923
- const sortedNamespaceImports = stableSort(namespaceImports, (i1, i2) => comparer(i1.importClause.namedBindings.name.text, i2.importClause.namedBindings.name.text));
167924
- for (const namespaceImport of sortedNamespaceImports) {
167925
- coalescedImports.push(
167926
- updateImportDeclarationAndClause(
167927
- namespaceImport,
167928
- /*name*/
167929
- void 0,
167930
- namespaceImport.importClause.namedBindings
167931
- )
167932
- );
167933
- }
167934
- const firstDefaultImport = firstOrUndefined(defaultImports);
167935
- const firstNamedImport = firstOrUndefined(namedImports);
167936
- const importDecl = firstDefaultImport ?? firstNamedImport;
167937
- if (!importDecl) {
167938
- continue;
167897
+ const importGroupsByAttributes = groupBy(importGroup, (decl) => {
167898
+ if (decl.attributes) {
167899
+ let attrs = decl.attributes.token + " ";
167900
+ for (const x of sort(decl.attributes.elements, (x2, y) => compareStringsCaseSensitive(x2.name.text, y.name.text))) {
167901
+ attrs += x.name.text + ":";
167902
+ attrs += isStringLiteralLike(x.value) ? `"${x.value.text}"` : x.value.getText() + " ";
167903
+ }
167904
+ return attrs;
167939
167905
  }
167940
- let newDefaultImport;
167941
- const newImportSpecifiers = [];
167942
- if (defaultImports.length === 1) {
167943
- newDefaultImport = defaultImports[0].importClause.name;
167944
- } else {
167945
- for (const defaultImport of defaultImports) {
167946
- newImportSpecifiers.push(
167947
- factory.createImportSpecifier(
167948
- /*isTypeOnly*/
167949
- false,
167950
- factory.createIdentifier("default"),
167951
- defaultImport.importClause.name
167906
+ return "";
167907
+ });
167908
+ const coalescedImports = [];
167909
+ for (const attribute in importGroupsByAttributes) {
167910
+ const importGroupSameAttrs = importGroupsByAttributes[attribute];
167911
+ const { importWithoutClause, typeOnlyImports, regularImports } = getCategorizedImports(importGroupSameAttrs);
167912
+ if (importWithoutClause) {
167913
+ coalescedImports.push(importWithoutClause);
167914
+ }
167915
+ for (const group2 of [regularImports, typeOnlyImports]) {
167916
+ const isTypeOnly = group2 === typeOnlyImports;
167917
+ const { defaultImports, namespaceImports, namedImports } = group2;
167918
+ if (!isTypeOnly && defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) {
167919
+ const defaultImport = defaultImports[0];
167920
+ coalescedImports.push(
167921
+ updateImportDeclarationAndClause(defaultImport, defaultImport.importClause.name, namespaceImports[0].importClause.namedBindings)
167922
+ );
167923
+ continue;
167924
+ }
167925
+ const sortedNamespaceImports = stableSort(namespaceImports, (i1, i2) => comparer(i1.importClause.namedBindings.name.text, i2.importClause.namedBindings.name.text));
167926
+ for (const namespaceImport of sortedNamespaceImports) {
167927
+ coalescedImports.push(
167928
+ updateImportDeclarationAndClause(
167929
+ namespaceImport,
167930
+ /*name*/
167931
+ void 0,
167932
+ namespaceImport.importClause.namedBindings
167952
167933
  )
167953
167934
  );
167954
167935
  }
167955
- }
167956
- newImportSpecifiers.push(...getNewImportSpecifiers(namedImports));
167957
- const sortedImportSpecifiers = factory.createNodeArray(
167958
- sortSpecifiers(newImportSpecifiers, comparer, preferences),
167959
- firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings.elements.hasTrailingComma
167960
- );
167961
- const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : firstNamedImport ? factory.updateNamedImports(firstNamedImport.importClause.namedBindings, sortedImportSpecifiers) : factory.createNamedImports(sortedImportSpecifiers);
167962
- if (sourceFile && newNamedImports && (firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings) && !rangeIsOnSingleLine(firstNamedImport.importClause.namedBindings, sourceFile)) {
167963
- setEmitFlags(newNamedImports, 2 /* MultiLine */);
167964
- }
167965
- if (isTypeOnly && newDefaultImport && newNamedImports) {
167966
- coalescedImports.push(
167967
- updateImportDeclarationAndClause(
167968
- importDecl,
167969
- newDefaultImport,
167970
- /*namedBindings*/
167971
- void 0
167972
- )
167973
- );
167974
- coalescedImports.push(
167975
- updateImportDeclarationAndClause(
167976
- firstNamedImport ?? importDecl,
167977
- /*name*/
167978
- void 0,
167979
- newNamedImports
167980
- )
167981
- );
167982
- } else {
167983
- coalescedImports.push(
167984
- updateImportDeclarationAndClause(importDecl, newDefaultImport, newNamedImports)
167936
+ const firstDefaultImport = firstOrUndefined(defaultImports);
167937
+ const firstNamedImport = firstOrUndefined(namedImports);
167938
+ const importDecl = firstDefaultImport ?? firstNamedImport;
167939
+ if (!importDecl) {
167940
+ continue;
167941
+ }
167942
+ let newDefaultImport;
167943
+ const newImportSpecifiers = [];
167944
+ if (defaultImports.length === 1) {
167945
+ newDefaultImport = defaultImports[0].importClause.name;
167946
+ } else {
167947
+ for (const defaultImport of defaultImports) {
167948
+ newImportSpecifiers.push(
167949
+ factory.createImportSpecifier(
167950
+ /*isTypeOnly*/
167951
+ false,
167952
+ factory.createIdentifier("default"),
167953
+ defaultImport.importClause.name
167954
+ )
167955
+ );
167956
+ }
167957
+ }
167958
+ newImportSpecifiers.push(...getNewImportSpecifiers(namedImports));
167959
+ const sortedImportSpecifiers = factory.createNodeArray(
167960
+ sortSpecifiers(newImportSpecifiers, comparer, preferences),
167961
+ firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings.elements.hasTrailingComma
167985
167962
  );
167963
+ const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : firstNamedImport ? factory.updateNamedImports(firstNamedImport.importClause.namedBindings, sortedImportSpecifiers) : factory.createNamedImports(sortedImportSpecifiers);
167964
+ if (sourceFile && newNamedImports && (firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings) && !rangeIsOnSingleLine(firstNamedImport.importClause.namedBindings, sourceFile)) {
167965
+ setEmitFlags(newNamedImports, 2 /* MultiLine */);
167966
+ }
167967
+ if (isTypeOnly && newDefaultImport && newNamedImports) {
167968
+ coalescedImports.push(
167969
+ updateImportDeclarationAndClause(
167970
+ importDecl,
167971
+ newDefaultImport,
167972
+ /*namedBindings*/
167973
+ void 0
167974
+ )
167975
+ );
167976
+ coalescedImports.push(
167977
+ updateImportDeclarationAndClause(
167978
+ firstNamedImport ?? importDecl,
167979
+ /*name*/
167980
+ void 0,
167981
+ newNamedImports
167982
+ )
167983
+ );
167984
+ } else {
167985
+ coalescedImports.push(
167986
+ updateImportDeclarationAndClause(importDecl, newDefaultImport, newNamedImports)
167987
+ );
167988
+ }
167986
167989
  }
167987
167990
  }
167988
167991
  return coalescedImports;
@@ -178475,6 +178478,7 @@ var Project3 = class _Project {
178475
178478
  /**
178476
178479
  * Current project's program version. (incremented everytime new program is created that is not complete reuse from the old one)
178477
178480
  * This property is changed in 'updateGraph' based on the set of files in program
178481
+ * @internal
178478
178482
  */
178479
178483
  this.projectProgramVersion = 0;
178480
178484
  /**
@@ -178482,6 +178486,7 @@ var Project3 = class _Project {
178482
178486
  * - new root file was added/removed
178483
178487
  * - edit happen in some file that is currently included in the project.
178484
178488
  * This property is different from projectStructureVersion since in most cases edits don't affect set of files in the project
178489
+ * @internal
178485
178490
  */
178486
178491
  this.projectStateVersion = 0;
178487
178492
  this.isInitialLoadPending = returnFalse;
@@ -179519,7 +179524,7 @@ var Project3 = class _Project {
179519
179524
  );
179520
179525
  const elapsed = timestamp() - start2;
179521
179526
  this.sendPerformanceEvent("UpdateGraph", elapsed);
179522
- this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} Version: ${this.getProjectVersion()} structureChanged: ${hasNewProgram}${this.program ? ` structureIsReused:: ${StructureIsReused[this.program.structureIsReused]}` : ""} Elapsed: ${elapsed}ms`);
179527
+ this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} projectStateVersion: ${this.projectStateVersion} projectProgramVersion: ${this.projectProgramVersion} structureChanged: ${hasNewProgram}${this.program ? ` structureIsReused:: ${StructureIsReused[this.program.structureIsReused]}` : ""} Elapsed: ${elapsed}ms`);
179523
179528
  if (this.projectService.logger.isTestLogger) {
179524
179529
  if (this.program !== oldProgram) {
179525
179530
  this.print(
@@ -179682,6 +179687,7 @@ var Project3 = class _Project {
179682
179687
  }
179683
179688
  /** @internal */
179684
179689
  print(writeProjectFileNames, writeFileExplaination, writeFileVersionAndText) {
179690
+ var _a;
179685
179691
  this.writeLog(`Project '${this.projectName}' (${ProjectKind[this.projectKind]})`);
179686
179692
  this.writeLog(this.filesToStringWorker(
179687
179693
  writeProjectFileNames && this.projectService.logger.hasLevel(3 /* verbose */),
@@ -179699,6 +179705,14 @@ var Project3 = class _Project {
179699
179705
  false
179700
179706
  );
179701
179707
  }
179708
+ (_a = this.noDtsResolutionProject) == null ? void 0 : _a.print(
179709
+ /*writeProjectFileNames*/
179710
+ false,
179711
+ /*writeFileExplaination*/
179712
+ false,
179713
+ /*writeFileVersionAndText*/
179714
+ false
179715
+ );
179702
179716
  }
179703
179717
  setCompilerOptions(compilerOptions) {
179704
179718
  var _a;
@@ -181139,6 +181153,8 @@ var _ProjectService = class _ProjectService {
181139
181153
  /** @internal */
181140
181154
  this.extendedConfigCache = /* @__PURE__ */ new Map();
181141
181155
  /** @internal */
181156
+ this.baseline = noop;
181157
+ /** @internal */
181142
181158
  this.verifyDocumentRegistry = noop;
181143
181159
  /** @internal */
181144
181160
  this.verifyProgram = noop;
@@ -183128,6 +183144,8 @@ Dynamic files must always be opened with service's current directory or service
183128
183144
  });
183129
183145
  this.inferredProjects.forEach((project) => this.clearSemanticCache(project));
183130
183146
  this.ensureProjectForOpenFiles();
183147
+ this.logger.info("After reloading projects..");
183148
+ this.printProjects();
183131
183149
  }
183132
183150
  /**
183133
183151
  * This function goes through all the openFiles and tries to file the config file for them.
@@ -183653,7 +183671,7 @@ Dynamic files must always be opened with service's current directory or service
183653
183671
  }
183654
183672
  }
183655
183673
  }
183656
- closeExternalProject(uncheckedFileName) {
183674
+ closeExternalProject(uncheckedFileName, print) {
183657
183675
  const fileName = toNormalizedPath(uncheckedFileName);
183658
183676
  const configFiles = this.externalProjectToConfiguredProjectMap.get(fileName);
183659
183677
  if (configFiles) {
@@ -183667,6 +183685,8 @@ Dynamic files must always be opened with service's current directory or service
183667
183685
  this.removeProject(externalProject);
183668
183686
  }
183669
183687
  }
183688
+ if (print)
183689
+ this.printProjects();
183670
183690
  }
183671
183691
  openExternalProjects(projects) {
183672
183692
  const projectsToClose = arrayToMap(this.externalProjects, (p) => p.getProjectName(), (_) => true);
@@ -183674,12 +183694,21 @@ Dynamic files must always be opened with service's current directory or service
183674
183694
  projectsToClose.set(externalProjectName, true);
183675
183695
  });
183676
183696
  for (const externalProject of projects) {
183677
- this.openExternalProject(externalProject);
183697
+ this.openExternalProject(
183698
+ externalProject,
183699
+ /*print*/
183700
+ false
183701
+ );
183678
183702
  projectsToClose.delete(externalProject.projectFileName);
183679
183703
  }
183680
183704
  forEachKey(projectsToClose, (externalProjectName) => {
183681
- this.closeExternalProject(externalProjectName);
183705
+ this.closeExternalProject(
183706
+ externalProjectName,
183707
+ /*print*/
183708
+ false
183709
+ );
183682
183710
  });
183711
+ this.printProjects();
183683
183712
  }
183684
183713
  static escapeFilenameForRegex(filename) {
183685
183714
  return filename.replace(this.filenameEscapeRegexp, "\\$&");
@@ -183772,7 +183801,7 @@ Dynamic files must always be opened with service's current directory or service
183772
183801
  proj.rootFiles = filesToKeep;
183773
183802
  return excludedFiles;
183774
183803
  }
183775
- openExternalProject(proj) {
183804
+ openExternalProject(proj, print) {
183776
183805
  proj.typeAcquisition = proj.typeAcquisition || {};
183777
183806
  proj.typeAcquisition.include = proj.typeAcquisition.include || [];
183778
183807
  proj.typeAcquisition.exclude = proj.typeAcquisition.exclude || [];
@@ -183811,12 +183840,22 @@ Dynamic files must always be opened with service's current directory or service
183811
183840
  externalProject.setProjectErrors(watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.errors);
183812
183841
  this.updateRootAndOptionsOfNonInferredProject(externalProject, proj.rootFiles, externalFilePropertyReader, compilerOptions, proj.typeAcquisition, proj.options.compileOnSave, watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.watchOptions);
183813
183842
  externalProject.updateGraph();
183843
+ if (print)
183844
+ this.printProjects();
183814
183845
  return;
183815
183846
  }
183816
- this.closeExternalProject(proj.projectFileName);
183847
+ this.closeExternalProject(
183848
+ proj.projectFileName,
183849
+ /*print*/
183850
+ false
183851
+ );
183817
183852
  } else if (this.externalProjectToConfiguredProjectMap.get(proj.projectFileName)) {
183818
183853
  if (!tsConfigFiles) {
183819
- this.closeExternalProject(proj.projectFileName);
183854
+ this.closeExternalProject(
183855
+ proj.projectFileName,
183856
+ /*print*/
183857
+ false
183858
+ );
183820
183859
  } else {
183821
183860
  const oldConfigFiles = this.externalProjectToConfiguredProjectMap.get(proj.projectFileName);
183822
183861
  let iNew = 0;
@@ -183856,6 +183895,8 @@ Dynamic files must always be opened with service's current directory or service
183856
183895
  const project = this.createExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition, excludedFiles);
183857
183896
  project.updateGraph();
183858
183897
  }
183898
+ if (print)
183899
+ this.printProjects();
183859
183900
  }
183860
183901
  hasDeferredExtension() {
183861
183902
  for (const extension of this.hostConfiguration.extraFileExtensions) {
@@ -184782,7 +184823,11 @@ var Session3 = class _Session {
184782
184823
  return this.requiredResponse(response);
184783
184824
  },
184784
184825
  ["openExternalProject" /* OpenExternalProject */]: (request) => {
184785
- this.projectService.openExternalProject(request.arguments);
184826
+ this.projectService.openExternalProject(
184827
+ request.arguments,
184828
+ /*print*/
184829
+ true
184830
+ );
184786
184831
  return this.requiredResponse(
184787
184832
  /*response*/
184788
184833
  true
@@ -184796,7 +184841,11 @@ var Session3 = class _Session {
184796
184841
  );
184797
184842
  },
184798
184843
  ["closeExternalProject" /* CloseExternalProject */]: (request) => {
184799
- this.projectService.closeExternalProject(request.arguments.projectFileName);
184844
+ this.projectService.closeExternalProject(
184845
+ request.arguments.projectFileName,
184846
+ /*print*/
184847
+ true
184848
+ );
184800
184849
  return this.requiredResponse(
184801
184850
  /*response*/
184802
184851
  true
@@ -3332,18 +3332,6 @@ declare namespace ts {
3332
3332
  * Last version that was reported.
3333
3333
  */
3334
3334
  private lastReportedVersion;
3335
- /**
3336
- * Current project's program version. (incremented everytime new program is created that is not complete reuse from the old one)
3337
- * This property is changed in 'updateGraph' based on the set of files in program
3338
- */
3339
- private projectProgramVersion;
3340
- /**
3341
- * Current version of the project state. It is changed when:
3342
- * - new root file was added/removed
3343
- * - edit happen in some file that is currently included in the project.
3344
- * This property is different from projectStructureVersion since in most cases edits don't affect set of files in the project
3345
- */
3346
- private projectStateVersion;
3347
3335
  protected projectErrors: Diagnostic[] | undefined;
3348
3336
  protected isInitialLoadPending: () => boolean;
3349
3337
  private readonly cancellationToken;
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.4";
38
- version = `${versionMajorMinor}.0-dev.20240201`;
38
+ version = `${versionMajorMinor}.0-dev.20240203`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -8260,7 +8260,6 @@ ${lanes.join("\n")}
8260
8260
  Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, 3 /* Message */, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."),
8261
8261
  Specify_library_files_to_be_included_in_the_compilation: diag(6079, 3 /* Message */, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."),
8262
8262
  Specify_JSX_code_generation: diag(6080, 3 /* Message */, "Specify_JSX_code_generation_6080", "Specify JSX code generation."),
8263
- File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, 3 /* Message */, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."),
8264
8263
  Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, 1 /* Error */, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."),
8265
8264
  Base_directory_to_resolve_non_absolute_module_names: diag(6083, 3 /* Message */, "Base_directory_to_resolve_non_absolute_module_names_6083", "Base directory to resolve non-absolute module names."),
8266
8265
  Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: diag(6084, 3 /* Message */, "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),
@@ -41225,15 +41224,9 @@ ${lanes.join("\n")}
41225
41224
  }
41226
41225
  }
41227
41226
  const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
41228
- const fromFile = tryFile(candidate2, onlyRecordFailures2, state2);
41227
+ const fromFile = loadFileNameFromPackageJsonField(extensions2, candidate2, onlyRecordFailures2, state2);
41229
41228
  if (fromFile) {
41230
- const resolved = resolvedIfExtensionMatches(extensions2, fromFile);
41231
- if (resolved) {
41232
- return noPackageId(resolved);
41233
- }
41234
- if (state2.traceEnabled) {
41235
- trace(state2.host, Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile);
41236
- }
41229
+ return noPackageId(fromFile);
41237
41230
  }
41238
41231
  const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
41239
41232
  const features = state2.features;
@@ -41289,10 +41282,6 @@ ${lanes.join("\n")}
41289
41282
  return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state);
41290
41283
  }
41291
41284
  }
41292
- function resolvedIfExtensionMatches(extensions, path, resolvedUsingTsExtension) {
41293
- const ext = tryGetExtensionFromPath2(path);
41294
- return ext !== void 0 && extensionIsOk(extensions, ext) ? { path, ext, resolvedUsingTsExtension } : void 0;
41295
- }
41296
41285
  function extensionIsOk(extensions, extension) {
41297
41286
  return extensions & 2 /* JavaScript */ && (extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */) || extensions & 1 /* TypeScript */ && (extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */) || extensions & 4 /* Declaration */ && (extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */) || extensions & 8 /* Json */ && extension === ".json" /* Json */ || false;
41298
41287
  }
@@ -167265,84 +167254,98 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
167265
167254
  if (importGroup.length === 0) {
167266
167255
  return importGroup;
167267
167256
  }
167268
- const { importWithoutClause, typeOnlyImports, regularImports } = getCategorizedImports(importGroup);
167269
- const coalescedImports = [];
167270
- if (importWithoutClause) {
167271
- coalescedImports.push(importWithoutClause);
167272
- }
167273
- for (const group2 of [regularImports, typeOnlyImports]) {
167274
- const isTypeOnly = group2 === typeOnlyImports;
167275
- const { defaultImports, namespaceImports, namedImports } = group2;
167276
- if (!isTypeOnly && defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) {
167277
- const defaultImport = defaultImports[0];
167278
- coalescedImports.push(
167279
- updateImportDeclarationAndClause(defaultImport, defaultImport.importClause.name, namespaceImports[0].importClause.namedBindings)
167280
- );
167281
- continue;
167282
- }
167283
- const sortedNamespaceImports = stableSort(namespaceImports, (i1, i2) => comparer(i1.importClause.namedBindings.name.text, i2.importClause.namedBindings.name.text));
167284
- for (const namespaceImport of sortedNamespaceImports) {
167285
- coalescedImports.push(
167286
- updateImportDeclarationAndClause(
167287
- namespaceImport,
167288
- /*name*/
167289
- void 0,
167290
- namespaceImport.importClause.namedBindings
167291
- )
167292
- );
167293
- }
167294
- const firstDefaultImport = firstOrUndefined(defaultImports);
167295
- const firstNamedImport = firstOrUndefined(namedImports);
167296
- const importDecl = firstDefaultImport ?? firstNamedImport;
167297
- if (!importDecl) {
167298
- continue;
167257
+ const importGroupsByAttributes = groupBy(importGroup, (decl) => {
167258
+ if (decl.attributes) {
167259
+ let attrs = decl.attributes.token + " ";
167260
+ for (const x of sort(decl.attributes.elements, (x2, y) => compareStringsCaseSensitive(x2.name.text, y.name.text))) {
167261
+ attrs += x.name.text + ":";
167262
+ attrs += isStringLiteralLike(x.value) ? `"${x.value.text}"` : x.value.getText() + " ";
167263
+ }
167264
+ return attrs;
167299
167265
  }
167300
- let newDefaultImport;
167301
- const newImportSpecifiers = [];
167302
- if (defaultImports.length === 1) {
167303
- newDefaultImport = defaultImports[0].importClause.name;
167304
- } else {
167305
- for (const defaultImport of defaultImports) {
167306
- newImportSpecifiers.push(
167307
- factory.createImportSpecifier(
167308
- /*isTypeOnly*/
167309
- false,
167310
- factory.createIdentifier("default"),
167311
- defaultImport.importClause.name
167266
+ return "";
167267
+ });
167268
+ const coalescedImports = [];
167269
+ for (const attribute in importGroupsByAttributes) {
167270
+ const importGroupSameAttrs = importGroupsByAttributes[attribute];
167271
+ const { importWithoutClause, typeOnlyImports, regularImports } = getCategorizedImports(importGroupSameAttrs);
167272
+ if (importWithoutClause) {
167273
+ coalescedImports.push(importWithoutClause);
167274
+ }
167275
+ for (const group2 of [regularImports, typeOnlyImports]) {
167276
+ const isTypeOnly = group2 === typeOnlyImports;
167277
+ const { defaultImports, namespaceImports, namedImports } = group2;
167278
+ if (!isTypeOnly && defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) {
167279
+ const defaultImport = defaultImports[0];
167280
+ coalescedImports.push(
167281
+ updateImportDeclarationAndClause(defaultImport, defaultImport.importClause.name, namespaceImports[0].importClause.namedBindings)
167282
+ );
167283
+ continue;
167284
+ }
167285
+ const sortedNamespaceImports = stableSort(namespaceImports, (i1, i2) => comparer(i1.importClause.namedBindings.name.text, i2.importClause.namedBindings.name.text));
167286
+ for (const namespaceImport of sortedNamespaceImports) {
167287
+ coalescedImports.push(
167288
+ updateImportDeclarationAndClause(
167289
+ namespaceImport,
167290
+ /*name*/
167291
+ void 0,
167292
+ namespaceImport.importClause.namedBindings
167312
167293
  )
167313
167294
  );
167314
167295
  }
167315
- }
167316
- newImportSpecifiers.push(...getNewImportSpecifiers(namedImports));
167317
- const sortedImportSpecifiers = factory.createNodeArray(
167318
- sortSpecifiers(newImportSpecifiers, comparer, preferences),
167319
- firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings.elements.hasTrailingComma
167320
- );
167321
- const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : firstNamedImport ? factory.updateNamedImports(firstNamedImport.importClause.namedBindings, sortedImportSpecifiers) : factory.createNamedImports(sortedImportSpecifiers);
167322
- if (sourceFile && newNamedImports && (firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings) && !rangeIsOnSingleLine(firstNamedImport.importClause.namedBindings, sourceFile)) {
167323
- setEmitFlags(newNamedImports, 2 /* MultiLine */);
167324
- }
167325
- if (isTypeOnly && newDefaultImport && newNamedImports) {
167326
- coalescedImports.push(
167327
- updateImportDeclarationAndClause(
167328
- importDecl,
167329
- newDefaultImport,
167330
- /*namedBindings*/
167331
- void 0
167332
- )
167333
- );
167334
- coalescedImports.push(
167335
- updateImportDeclarationAndClause(
167336
- firstNamedImport ?? importDecl,
167337
- /*name*/
167338
- void 0,
167339
- newNamedImports
167340
- )
167341
- );
167342
- } else {
167343
- coalescedImports.push(
167344
- updateImportDeclarationAndClause(importDecl, newDefaultImport, newNamedImports)
167296
+ const firstDefaultImport = firstOrUndefined(defaultImports);
167297
+ const firstNamedImport = firstOrUndefined(namedImports);
167298
+ const importDecl = firstDefaultImport ?? firstNamedImport;
167299
+ if (!importDecl) {
167300
+ continue;
167301
+ }
167302
+ let newDefaultImport;
167303
+ const newImportSpecifiers = [];
167304
+ if (defaultImports.length === 1) {
167305
+ newDefaultImport = defaultImports[0].importClause.name;
167306
+ } else {
167307
+ for (const defaultImport of defaultImports) {
167308
+ newImportSpecifiers.push(
167309
+ factory.createImportSpecifier(
167310
+ /*isTypeOnly*/
167311
+ false,
167312
+ factory.createIdentifier("default"),
167313
+ defaultImport.importClause.name
167314
+ )
167315
+ );
167316
+ }
167317
+ }
167318
+ newImportSpecifiers.push(...getNewImportSpecifiers(namedImports));
167319
+ const sortedImportSpecifiers = factory.createNodeArray(
167320
+ sortSpecifiers(newImportSpecifiers, comparer, preferences),
167321
+ firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings.elements.hasTrailingComma
167345
167322
  );
167323
+ const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : firstNamedImport ? factory.updateNamedImports(firstNamedImport.importClause.namedBindings, sortedImportSpecifiers) : factory.createNamedImports(sortedImportSpecifiers);
167324
+ if (sourceFile && newNamedImports && (firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings) && !rangeIsOnSingleLine(firstNamedImport.importClause.namedBindings, sourceFile)) {
167325
+ setEmitFlags(newNamedImports, 2 /* MultiLine */);
167326
+ }
167327
+ if (isTypeOnly && newDefaultImport && newNamedImports) {
167328
+ coalescedImports.push(
167329
+ updateImportDeclarationAndClause(
167330
+ importDecl,
167331
+ newDefaultImport,
167332
+ /*namedBindings*/
167333
+ void 0
167334
+ )
167335
+ );
167336
+ coalescedImports.push(
167337
+ updateImportDeclarationAndClause(
167338
+ firstNamedImport ?? importDecl,
167339
+ /*name*/
167340
+ void 0,
167341
+ newNamedImports
167342
+ )
167343
+ );
167344
+ } else {
167345
+ coalescedImports.push(
167346
+ updateImportDeclarationAndClause(importDecl, newDefaultImport, newNamedImports)
167347
+ );
167348
+ }
167346
167349
  }
167347
167350
  }
167348
167351
  return coalescedImports;
@@ -175795,6 +175798,7 @@ ${options.prefix}` : "\n" : options.prefix
175795
175798
  /**
175796
175799
  * Current project's program version. (incremented everytime new program is created that is not complete reuse from the old one)
175797
175800
  * This property is changed in 'updateGraph' based on the set of files in program
175801
+ * @internal
175798
175802
  */
175799
175803
  this.projectProgramVersion = 0;
175800
175804
  /**
@@ -175802,6 +175806,7 @@ ${options.prefix}` : "\n" : options.prefix
175802
175806
  * - new root file was added/removed
175803
175807
  * - edit happen in some file that is currently included in the project.
175804
175808
  * This property is different from projectStructureVersion since in most cases edits don't affect set of files in the project
175809
+ * @internal
175805
175810
  */
175806
175811
  this.projectStateVersion = 0;
175807
175812
  this.isInitialLoadPending = returnFalse;
@@ -176839,7 +176844,7 @@ ${options.prefix}` : "\n" : options.prefix
176839
176844
  );
176840
176845
  const elapsed = timestamp() - start;
176841
176846
  this.sendPerformanceEvent("UpdateGraph", elapsed);
176842
- this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} Version: ${this.getProjectVersion()} structureChanged: ${hasNewProgram}${this.program ? ` structureIsReused:: ${StructureIsReused[this.program.structureIsReused]}` : ""} Elapsed: ${elapsed}ms`);
176847
+ this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} projectStateVersion: ${this.projectStateVersion} projectProgramVersion: ${this.projectProgramVersion} structureChanged: ${hasNewProgram}${this.program ? ` structureIsReused:: ${StructureIsReused[this.program.structureIsReused]}` : ""} Elapsed: ${elapsed}ms`);
176843
176848
  if (this.projectService.logger.isTestLogger) {
176844
176849
  if (this.program !== oldProgram) {
176845
176850
  this.print(
@@ -177002,6 +177007,7 @@ ${options.prefix}` : "\n" : options.prefix
177002
177007
  }
177003
177008
  /** @internal */
177004
177009
  print(writeProjectFileNames, writeFileExplaination, writeFileVersionAndText) {
177010
+ var _a;
177005
177011
  this.writeLog(`Project '${this.projectName}' (${ProjectKind[this.projectKind]})`);
177006
177012
  this.writeLog(this.filesToStringWorker(
177007
177013
  writeProjectFileNames && this.projectService.logger.hasLevel(3 /* verbose */),
@@ -177019,6 +177025,14 @@ ${options.prefix}` : "\n" : options.prefix
177019
177025
  false
177020
177026
  );
177021
177027
  }
177028
+ (_a = this.noDtsResolutionProject) == null ? void 0 : _a.print(
177029
+ /*writeProjectFileNames*/
177030
+ false,
177031
+ /*writeFileExplaination*/
177032
+ false,
177033
+ /*writeFileVersionAndText*/
177034
+ false
177035
+ );
177022
177036
  }
177023
177037
  setCompilerOptions(compilerOptions) {
177024
177038
  var _a;
@@ -178458,6 +178472,8 @@ ${options.prefix}` : "\n" : options.prefix
178458
178472
  /** @internal */
178459
178473
  this.extendedConfigCache = /* @__PURE__ */ new Map();
178460
178474
  /** @internal */
178475
+ this.baseline = noop;
178476
+ /** @internal */
178461
178477
  this.verifyDocumentRegistry = noop;
178462
178478
  /** @internal */
178463
178479
  this.verifyProgram = noop;
@@ -180447,6 +180463,8 @@ Dynamic files must always be opened with service's current directory or service
180447
180463
  });
180448
180464
  this.inferredProjects.forEach((project) => this.clearSemanticCache(project));
180449
180465
  this.ensureProjectForOpenFiles();
180466
+ this.logger.info("After reloading projects..");
180467
+ this.printProjects();
180450
180468
  }
180451
180469
  /**
180452
180470
  * This function goes through all the openFiles and tries to file the config file for them.
@@ -180972,7 +180990,7 @@ Dynamic files must always be opened with service's current directory or service
180972
180990
  }
180973
180991
  }
180974
180992
  }
180975
- closeExternalProject(uncheckedFileName) {
180993
+ closeExternalProject(uncheckedFileName, print) {
180976
180994
  const fileName = toNormalizedPath(uncheckedFileName);
180977
180995
  const configFiles = this.externalProjectToConfiguredProjectMap.get(fileName);
180978
180996
  if (configFiles) {
@@ -180986,6 +181004,8 @@ Dynamic files must always be opened with service's current directory or service
180986
181004
  this.removeProject(externalProject);
180987
181005
  }
180988
181006
  }
181007
+ if (print)
181008
+ this.printProjects();
180989
181009
  }
180990
181010
  openExternalProjects(projects) {
180991
181011
  const projectsToClose = arrayToMap(this.externalProjects, (p) => p.getProjectName(), (_) => true);
@@ -180993,12 +181013,21 @@ Dynamic files must always be opened with service's current directory or service
180993
181013
  projectsToClose.set(externalProjectName, true);
180994
181014
  });
180995
181015
  for (const externalProject of projects) {
180996
- this.openExternalProject(externalProject);
181016
+ this.openExternalProject(
181017
+ externalProject,
181018
+ /*print*/
181019
+ false
181020
+ );
180997
181021
  projectsToClose.delete(externalProject.projectFileName);
180998
181022
  }
180999
181023
  forEachKey(projectsToClose, (externalProjectName) => {
181000
- this.closeExternalProject(externalProjectName);
181024
+ this.closeExternalProject(
181025
+ externalProjectName,
181026
+ /*print*/
181027
+ false
181028
+ );
181001
181029
  });
181030
+ this.printProjects();
181002
181031
  }
181003
181032
  static escapeFilenameForRegex(filename) {
181004
181033
  return filename.replace(this.filenameEscapeRegexp, "\\$&");
@@ -181091,7 +181120,7 @@ Dynamic files must always be opened with service's current directory or service
181091
181120
  proj.rootFiles = filesToKeep;
181092
181121
  return excludedFiles;
181093
181122
  }
181094
- openExternalProject(proj) {
181123
+ openExternalProject(proj, print) {
181095
181124
  proj.typeAcquisition = proj.typeAcquisition || {};
181096
181125
  proj.typeAcquisition.include = proj.typeAcquisition.include || [];
181097
181126
  proj.typeAcquisition.exclude = proj.typeAcquisition.exclude || [];
@@ -181130,12 +181159,22 @@ Dynamic files must always be opened with service's current directory or service
181130
181159
  externalProject.setProjectErrors(watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.errors);
181131
181160
  this.updateRootAndOptionsOfNonInferredProject(externalProject, proj.rootFiles, externalFilePropertyReader, compilerOptions, proj.typeAcquisition, proj.options.compileOnSave, watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.watchOptions);
181132
181161
  externalProject.updateGraph();
181162
+ if (print)
181163
+ this.printProjects();
181133
181164
  return;
181134
181165
  }
181135
- this.closeExternalProject(proj.projectFileName);
181166
+ this.closeExternalProject(
181167
+ proj.projectFileName,
181168
+ /*print*/
181169
+ false
181170
+ );
181136
181171
  } else if (this.externalProjectToConfiguredProjectMap.get(proj.projectFileName)) {
181137
181172
  if (!tsConfigFiles) {
181138
- this.closeExternalProject(proj.projectFileName);
181173
+ this.closeExternalProject(
181174
+ proj.projectFileName,
181175
+ /*print*/
181176
+ false
181177
+ );
181139
181178
  } else {
181140
181179
  const oldConfigFiles = this.externalProjectToConfiguredProjectMap.get(proj.projectFileName);
181141
181180
  let iNew = 0;
@@ -181175,6 +181214,8 @@ Dynamic files must always be opened with service's current directory or service
181175
181214
  const project = this.createExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition, excludedFiles);
181176
181215
  project.updateGraph();
181177
181216
  }
181217
+ if (print)
181218
+ this.printProjects();
181178
181219
  }
181179
181220
  hasDeferredExtension() {
181180
181221
  for (const extension of this.hostConfiguration.extraFileExtensions) {
@@ -182170,7 +182211,11 @@ ${json}${newLine}`;
182170
182211
  return this.requiredResponse(response);
182171
182212
  },
182172
182213
  ["openExternalProject" /* OpenExternalProject */]: (request) => {
182173
- this.projectService.openExternalProject(request.arguments);
182214
+ this.projectService.openExternalProject(
182215
+ request.arguments,
182216
+ /*print*/
182217
+ true
182218
+ );
182174
182219
  return this.requiredResponse(
182175
182220
  /*response*/
182176
182221
  true
@@ -182184,7 +182229,11 @@ ${json}${newLine}`;
182184
182229
  );
182185
182230
  },
182186
182231
  ["closeExternalProject" /* CloseExternalProject */]: (request) => {
182187
- this.projectService.closeExternalProject(request.arguments.projectFileName);
182232
+ this.projectService.closeExternalProject(
182233
+ request.arguments.projectFileName,
182234
+ /*print*/
182235
+ true
182236
+ );
182188
182237
  return this.requiredResponse(
182189
182238
  /*response*/
182190
182239
  true
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.4";
57
- var version = `${versionMajorMinor}.0-dev.20240201`;
57
+ var version = `${versionMajorMinor}.0-dev.20240203`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -6299,7 +6299,6 @@ var Diagnostics = {
6299
6299
  Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, 3 /* Message */, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."),
6300
6300
  Specify_library_files_to_be_included_in_the_compilation: diag(6079, 3 /* Message */, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."),
6301
6301
  Specify_JSX_code_generation: diag(6080, 3 /* Message */, "Specify_JSX_code_generation_6080", "Specify JSX code generation."),
6302
- File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, 3 /* Message */, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."),
6303
6302
  Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, 1 /* Error */, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."),
6304
6303
  Base_directory_to_resolve_non_absolute_module_names: diag(6083, 3 /* Message */, "Base_directory_to_resolve_non_absolute_module_names_6083", "Base directory to resolve non-absolute module names."),
6305
6304
  Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: diag(6084, 3 /* Message */, "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),
@@ -28567,15 +28566,9 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
28567
28566
  }
28568
28567
  }
28569
28568
  const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
28570
- const fromFile = tryFile(candidate2, onlyRecordFailures2, state2);
28569
+ const fromFile = loadFileNameFromPackageJsonField(extensions2, candidate2, onlyRecordFailures2, state2);
28571
28570
  if (fromFile) {
28572
- const resolved = resolvedIfExtensionMatches(extensions2, fromFile);
28573
- if (resolved) {
28574
- return noPackageId(resolved);
28575
- }
28576
- if (state2.traceEnabled) {
28577
- trace(state2.host, Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile);
28578
- }
28571
+ return noPackageId(fromFile);
28579
28572
  }
28580
28573
  const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
28581
28574
  const features = state2.features;
@@ -28631,10 +28624,6 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
28631
28624
  return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state);
28632
28625
  }
28633
28626
  }
28634
- function resolvedIfExtensionMatches(extensions, path2, resolvedUsingTsExtension) {
28635
- const ext = tryGetExtensionFromPath2(path2);
28636
- return ext !== void 0 && extensionIsOk(extensions, ext) ? { path: path2, ext, resolvedUsingTsExtension } : void 0;
28637
- }
28638
28627
  function extensionIsOk(extensions, extension) {
28639
28628
  return extensions & 2 /* JavaScript */ && (extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */) || extensions & 1 /* TypeScript */ && (extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */) || extensions & 4 /* Declaration */ && (extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */) || extensions & 8 /* Json */ && extension === ".json" /* Json */ || false;
28640
28629
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.4.0-dev.20240201",
5
+ "version": "5.4.0-dev.20240203",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -113,5 +113,5 @@
113
113
  "node": "20.1.0",
114
114
  "npm": "8.19.4"
115
115
  },
116
- "gitHead": "f1c841b8257725f81c03a19bc55a56e4f2ea47c6"
116
+ "gitHead": "61200368bb440ba8a40641be87c44d875ca31f69"
117
117
  }