@effect/language-service 0.53.2 → 0.53.3

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/cli.js CHANGED
@@ -35596,6 +35596,13 @@ var diagnostics2 = make58(
35596
35596
  }
35597
35597
  const filesToCheckArray = fromIterable(filesToCheck);
35598
35598
  const batches = chunksOf(filesToCheckArray, BATCH_SIZE);
35599
+ let lastLanguageService;
35600
+ const disposeIfLanguageServiceChanged = (languageService) => {
35601
+ if (lastLanguageService !== languageService) {
35602
+ lastLanguageService?.dispose();
35603
+ lastLanguageService = languageService;
35604
+ }
35605
+ };
35599
35606
  for (const batch of batches) {
35600
35607
  const { service: service3 } = (0, import_project_service.createProjectService)({ options: { loadTypeScriptPlugins: false } });
35601
35608
  for (const filePath of batch) {
@@ -35605,6 +35612,7 @@ var diagnostics2 = make58(
35605
35612
  if (!scriptInfo) continue;
35606
35613
  const project4 = scriptInfo.getDefaultProject();
35607
35614
  const languageService = project4.getLanguageService(true);
35615
+ disposeIfLanguageServiceChanged(languageService);
35608
35616
  const program = languageService.getProgram();
35609
35617
  if (!program) continue;
35610
35618
  const sourceFile = program.getSourceFile(filePath);
@@ -35621,7 +35629,7 @@ var diagnostics2 = make58(
35621
35629
  provideService7(TypeScriptApi, tsInstance),
35622
35630
  provideService7(
35623
35631
  LanguageServicePluginOptions,
35624
- parse4(pluginConfig)
35632
+ { ...parse4(pluginConfig), diagnosticsName: false }
35625
35633
  ),
35626
35634
  run9,
35627
35635
  map((_) => _.diagnostics),
@@ -35637,11 +35645,14 @@ var diagnostics2 = make58(
35637
35645
  warningsCount += results.filter((_) => _.category === tsInstance.DiagnosticCategory.Warning).length;
35638
35646
  messagesCount += results.filter((_) => _.category === tsInstance.DiagnosticCategory.Message).length;
35639
35647
  if (results.length > 0) {
35640
- const formattedResults = tsInstance.formatDiagnosticsWithColorAndContext(results, {
35648
+ let formattedResults = tsInstance.formatDiagnosticsWithColorAndContext(results, {
35641
35649
  getCanonicalFileName: (fileName) => path2.resolve(fileName),
35642
35650
  getCurrentDirectory: () => path2.resolve("."),
35643
35651
  getNewLine: () => "\n"
35644
35652
  });
35653
+ Object.values(diagnostics).forEach(
35654
+ (_) => formattedResults = formattedResults.replace(new RegExp(`TS${_.code}:`, "g"), `effect(${_.name}):`)
35655
+ );
35645
35656
  console.log(formattedResults);
35646
35657
  }
35647
35658
  } finally {
@@ -35650,6 +35661,7 @@ var diagnostics2 = make58(
35650
35661
  }
35651
35662
  yield* yieldNow4();
35652
35663
  }
35664
+ disposeIfLanguageServiceChanged(void 0);
35653
35665
  console.log(
35654
35666
  `Checked ${checkedFilesCount} files out of ${filesToCheck.size} files.
35655
35667
  ${errorsCount} errors, ${warningsCount} warnings and ${messagesCount} messages.`