@effect/language-service 0.71.0 → 0.71.1

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/README.md CHANGED
@@ -141,6 +141,8 @@ Few options can be provided alongside the initialization of the Language Service
141
141
  "diagnosticsName": true, // controls whether to include the rule name in diagnostic messages (default: true)
142
142
  "missingDiagnosticNextLine": "warning", // controls the severity of warnings for unused @effect-diagnostics-next-line comments (default: "warning", allowed values: off,error,warning,message,suggestion)
143
143
  "includeSuggestionsInTsc": true, // when enabled with effect-language-service patch enabled, diagnostics with "suggestion" severity will be reported as "message" in TSC with "[suggestion]" prefix; useful to help steer LLM output (default: true)
144
+ "ignoreEffectWarningsInTscExitCode": false, // if set to true, effect-related warnings won't change the exit code of tsc, meaning that tsc will compile fine even if effect warnings are emitted (default: false)
145
+ "ignoreEffectSuggestionsInTscExitCode": true, // if set to true, effect-related suggestions won't change the exit code of tsc (default: true)
144
146
  "quickinfo": true, // controls Effect quickinfo (default: true)
145
147
  "quickinfoEffectParameters": "whenTruncated", // (default: "whenTruncated") controls when to display effect type parameters always,never,whenTruncated
146
148
  "quickinfoMaximumLength": -1, // controls how long can be the types in the quickinfo hover (helps with very long type to improve perfs, defaults to -1 for no truncation, can be any number eg. 1000 and TS will try to fit as much as possible in that budget, higher number means more info.)
package/cli.js CHANGED
@@ -30214,7 +30214,7 @@ var runMain3 = runMain2;
30214
30214
  // package.json
30215
30215
  var package_default = {
30216
30216
  name: "@effect/language-service",
30217
- version: "0.71.0",
30217
+ version: "0.71.1",
30218
30218
  packageManager: "pnpm@8.11.0",
30219
30219
  publishConfig: {
30220
30220
  access: "public",
@@ -32038,6 +32038,8 @@ var defaults = {
32038
32038
  skipLeadingPath: ["src/"]
32039
32039
  }],
32040
32040
  extendedKeyDetection: false,
32041
+ ignoreEffectWarningsInTscExitCode: false,
32042
+ ignoreEffectSuggestionsInTscExitCode: true,
32041
32043
  pipeableMinArgCount: 2,
32042
32044
  effectFn: ["span"],
32043
32045
  layerGraphFollowDepth: 0,
@@ -32063,6 +32065,8 @@ function parse4(config2) {
32063
32065
  diagnosticsName: isObject(config2) && hasProperty(config2, "diagnosticsName") && isBoolean(config2.diagnosticsName) ? config2.diagnosticsName : defaults.diagnosticsName,
32064
32066
  missingDiagnosticNextLine: isObject(config2) && hasProperty(config2, "missingDiagnosticNextLine") && isString(config2.missingDiagnosticNextLine) && isValidSeverityLevel(config2.missingDiagnosticNextLine) ? config2.missingDiagnosticNextLine : defaults.missingDiagnosticNextLine,
32065
32067
  includeSuggestionsInTsc: isObject(config2) && hasProperty(config2, "includeSuggestionsInTsc") && isBoolean(config2.includeSuggestionsInTsc) ? config2.includeSuggestionsInTsc : defaults.includeSuggestionsInTsc,
32068
+ ignoreEffectWarningsInTscExitCode: isObject(config2) && hasProperty(config2, "ignoreEffectWarningsInTscExitCode") && isBoolean(config2.ignoreEffectWarningsInTscExitCode) ? config2.ignoreEffectWarningsInTscExitCode : defaults.ignoreEffectWarningsInTscExitCode,
32069
+ ignoreEffectSuggestionsInTscExitCode: isObject(config2) && hasProperty(config2, "ignoreEffectSuggestionsInTscExitCode") && isBoolean(config2.ignoreEffectSuggestionsInTscExitCode) ? config2.ignoreEffectSuggestionsInTscExitCode : defaults.ignoreEffectSuggestionsInTscExitCode,
32066
32070
  quickinfo: isObject(config2) && hasProperty(config2, "quickinfo") && isBoolean(config2.quickinfo) ? config2.quickinfo : defaults.quickinfo,
32067
32071
  quickinfoEffectParameters: isObject(config2) && hasProperty(config2, "quickinfoEffectParameters") && isString(config2.quickinfoEffectParameters) && ["always", "never", "whentruncated"].includes(config2.quickinfoEffectParameters.toLowerCase()) ? config2.quickinfoEffectParameters.toLowerCase() : defaults.quickinfoEffectParameters,
32068
32072
  quickinfoMaximumLength: isObject(config2) && hasProperty(config2, "quickinfoMaximumLength") && isNumber(config2.quickinfoMaximumLength) ? config2.quickinfoMaximumLength : defaults.quickinfoMaximumLength,
@@ -41506,6 +41510,8 @@ var getPatchesForModule = fn("getPatchesForModule")(
41506
41510
  let insertCheckSourceFilePosition = none2();
41507
41511
  let insertSkipPrecedingCommentDirectivePosition = none2();
41508
41512
  let insertAppendMetadataRelationErrorPosition = none2();
41513
+ let insertExtractDiagnosticsForExitStatusPosition = none2();
41514
+ let replacedBindingExtractDiagnosticsForExitStatus = none2();
41509
41515
  let nodesToCheck = [];
41510
41516
  function findNodeAtPositionIncludingTrivia(sourceFile2, position) {
41511
41517
  function find3(node) {
@@ -41534,6 +41540,7 @@ var getPatchesForModule = fn("getPatchesForModule")(
41534
41540
  if (!pushFunctionDeclarationNode("checkSourceFileWorker")) requiresFullScan = true;
41535
41541
  if (!pushFunctionDeclarationNode("markPrecedingCommentDirectiveLine")) requiresFullScan = true;
41536
41542
  if (!pushFunctionDeclarationNode("reportRelationError")) requiresFullScan = true;
41543
+ if (!pushFunctionDeclarationNode("emitFilesAndReportErrorsAndGetExitStatus")) requiresFullScan = true;
41537
41544
  if (requiresFullScan) nodesToCheck = [sourceFile];
41538
41545
  while (nodesToCheck.length > 0) {
41539
41546
  const node = nodesToCheck.shift();
@@ -41568,6 +41575,29 @@ var getPatchesForModule = fn("getPatchesForModule")(
41568
41575
  });
41569
41576
  }
41570
41577
  }
41578
+ } else if (ts.isCallExpression(node)) {
41579
+ const callee = node.expression;
41580
+ if (ts.isIdentifier(callee) && ts.idText(callee) === "emitFilesAndReportErrors") {
41581
+ const parentVariableDeclaration = ts.findAncestor(node, ts.isVariableDeclaration);
41582
+ if (parentVariableDeclaration) {
41583
+ const parentVariableStatement = ts.findAncestor(parentVariableDeclaration, ts.isVariableStatement);
41584
+ if (parentVariableStatement) {
41585
+ const parentBlock = parentVariableStatement.parent;
41586
+ if (ts.isBlock(parentBlock)) {
41587
+ const parentFunctionDeclaration = parentBlock.parent;
41588
+ if (ts.isFunctionDeclaration(parentFunctionDeclaration) && parentFunctionDeclaration.name && ts.isIdentifier(parentFunctionDeclaration.name) && ts.idText(parentFunctionDeclaration.name) === "emitFilesAndReportErrorsAndGetExitStatus") {
41589
+ insertExtractDiagnosticsForExitStatusPosition = some2({
41590
+ position: parentVariableStatement.end
41591
+ });
41592
+ replacedBindingExtractDiagnosticsForExitStatus = some2({
41593
+ pos: parentVariableDeclaration.name.pos,
41594
+ end: parentVariableDeclaration.name.end
41595
+ });
41596
+ }
41597
+ }
41598
+ }
41599
+ }
41600
+ }
41571
41601
  }
41572
41602
  ts.forEachChild(node, (child) => {
41573
41603
  nodesToCheck.push(child);
@@ -41622,9 +41652,7 @@ var getPatchesForModule = fn("getPatchesForModule")(
41622
41652
  )
41623
41653
  );
41624
41654
  if (isNone2(insertSkipPrecedingCommentDirectivePosition)) {
41625
- return yield* fail7(
41626
- new UnableToFindPositionToPatchError({ positionToFind: "skip preceding comment directive" })
41627
- );
41655
+ return yield* new UnableToFindPositionToPatchError({ positionToFind: "skip preceding comment directive" });
41628
41656
  }
41629
41657
  patches.push(
41630
41658
  yield* makeEffectLspPatchChange(
@@ -41636,6 +41664,33 @@ var getPatchesForModule = fn("getPatchesForModule")(
41636
41664
  version
41637
41665
  )
41638
41666
  );
41667
+ if (isNone2(insertExtractDiagnosticsForExitStatusPosition)) {
41668
+ return yield* new UnableToFindPositionToPatchError({ positionToFind: "extractDiagnosticsForExitStatus" });
41669
+ }
41670
+ if (isNone2(replacedBindingExtractDiagnosticsForExitStatus)) {
41671
+ return yield* new UnableToFindPositionToPatchError({ positionToFind: "extractDiagnosticsForExitStatus-binding" });
41672
+ }
41673
+ patches.push(
41674
+ yield* makeEffectLspPatchChange(
41675
+ sourceFile.text,
41676
+ replacedBindingExtractDiagnosticsForExitStatus.value.pos,
41677
+ replacedBindingExtractDiagnosticsForExitStatus.value.end,
41678
+ ` { emitResult, diagnostics: tscDiagnostics }`,
41679
+ " ",
41680
+ version
41681
+ )
41682
+ );
41683
+ patches.push(
41684
+ yield* makeEffectLspPatchChange(
41685
+ sourceFile.text,
41686
+ insertExtractDiagnosticsForExitStatusPosition.value.position,
41687
+ insertExtractDiagnosticsForExitStatusPosition.value.position,
41688
+ `const diagnostics = effectLspPatchUtils().extractDiagnosticsForExitStatus(${moduleName === "typescript" ? "module.exports" : "effectLspTypeScriptApis()"}, program, tscDiagnostics, "${moduleName}")
41689
+ `,
41690
+ "\n",
41691
+ version
41692
+ )
41693
+ );
41639
41694
  let eofPos = sourceFile.text.lastIndexOf("// src/") - 1;
41640
41695
  if (eofPos < 0) eofPos = sourceFile.text.length;
41641
41696
  if (moduleName !== "typescript") {