@effect/language-service 0.71.0 → 0.71.2
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 +2 -0
- package/cli.js +40 -4
- package/cli.js.map +1 -1
- package/effect-lsp-patch-utils.js +26 -2
- package/effect-lsp-patch-utils.js.map +1 -1
- package/index.js +4 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/transform.js +4 -0
- package/transform.js.map +1 -1
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.
|
|
30217
|
+
version: "0.71.2",
|
|
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,7 @@ var getPatchesForModule = fn("getPatchesForModule")(
|
|
|
41506
41510
|
let insertCheckSourceFilePosition = none2();
|
|
41507
41511
|
let insertSkipPrecedingCommentDirectivePosition = none2();
|
|
41508
41512
|
let insertAppendMetadataRelationErrorPosition = none2();
|
|
41513
|
+
let insertEmitFilesAndReportErrorsDiagnosticsRange = none2();
|
|
41509
41514
|
let nodesToCheck = [];
|
|
41510
41515
|
function findNodeAtPositionIncludingTrivia(sourceFile2, position) {
|
|
41511
41516
|
function find3(node) {
|
|
@@ -41534,6 +41539,7 @@ var getPatchesForModule = fn("getPatchesForModule")(
|
|
|
41534
41539
|
if (!pushFunctionDeclarationNode("checkSourceFileWorker")) requiresFullScan = true;
|
|
41535
41540
|
if (!pushFunctionDeclarationNode("markPrecedingCommentDirectiveLine")) requiresFullScan = true;
|
|
41536
41541
|
if (!pushFunctionDeclarationNode("reportRelationError")) requiresFullScan = true;
|
|
41542
|
+
if (!pushFunctionDeclarationNode("emitFilesAndReportErrors")) requiresFullScan = true;
|
|
41537
41543
|
if (requiresFullScan) nodesToCheck = [sourceFile];
|
|
41538
41544
|
while (nodesToCheck.length > 0) {
|
|
41539
41545
|
const node = nodesToCheck.shift();
|
|
@@ -41568,6 +41574,24 @@ var getPatchesForModule = fn("getPatchesForModule")(
|
|
|
41568
41574
|
});
|
|
41569
41575
|
}
|
|
41570
41576
|
}
|
|
41577
|
+
} else if (ts.isReturnStatement(node)) {
|
|
41578
|
+
const parentBlock = node.parent;
|
|
41579
|
+
if (parentBlock && ts.isBlock(parentBlock)) {
|
|
41580
|
+
const parentFunctionDeclaration = parentBlock.parent;
|
|
41581
|
+
if (parentFunctionDeclaration && ts.isFunctionDeclaration(parentFunctionDeclaration) && parentFunctionDeclaration.name && ts.isIdentifier(parentFunctionDeclaration.name) && ts.idText(parentFunctionDeclaration.name) === "emitFilesAndReportErrors") {
|
|
41582
|
+
if (node.expression && ts.isObjectLiteralExpression(node.expression)) {
|
|
41583
|
+
const properties = node.expression.properties;
|
|
41584
|
+
for (const property of properties) {
|
|
41585
|
+
if (property && ts.isShorthandPropertyAssignment(property) && property.name && ts.isIdentifier(property.name) && ts.idText(property.name) === "diagnostics") {
|
|
41586
|
+
insertEmitFilesAndReportErrorsDiagnosticsRange = some2({
|
|
41587
|
+
pos: property.pos,
|
|
41588
|
+
end: property.end
|
|
41589
|
+
});
|
|
41590
|
+
}
|
|
41591
|
+
}
|
|
41592
|
+
}
|
|
41593
|
+
}
|
|
41594
|
+
}
|
|
41571
41595
|
}
|
|
41572
41596
|
ts.forEachChild(node, (child) => {
|
|
41573
41597
|
nodesToCheck.push(child);
|
|
@@ -41622,9 +41646,7 @@ var getPatchesForModule = fn("getPatchesForModule")(
|
|
|
41622
41646
|
)
|
|
41623
41647
|
);
|
|
41624
41648
|
if (isNone2(insertSkipPrecedingCommentDirectivePosition)) {
|
|
41625
|
-
return yield*
|
|
41626
|
-
new UnableToFindPositionToPatchError({ positionToFind: "skip preceding comment directive" })
|
|
41627
|
-
);
|
|
41649
|
+
return yield* new UnableToFindPositionToPatchError({ positionToFind: "skip preceding comment directive" });
|
|
41628
41650
|
}
|
|
41629
41651
|
patches.push(
|
|
41630
41652
|
yield* makeEffectLspPatchChange(
|
|
@@ -41636,6 +41658,20 @@ var getPatchesForModule = fn("getPatchesForModule")(
|
|
|
41636
41658
|
version
|
|
41637
41659
|
)
|
|
41638
41660
|
);
|
|
41661
|
+
if (isNone2(insertEmitFilesAndReportErrorsDiagnosticsRange)) {
|
|
41662
|
+
return yield* new UnableToFindPositionToPatchError({ positionToFind: "extractDiagnosticsForExitStatus" });
|
|
41663
|
+
}
|
|
41664
|
+
patches.push(
|
|
41665
|
+
yield* makeEffectLspPatchChange(
|
|
41666
|
+
sourceFile.text,
|
|
41667
|
+
insertEmitFilesAndReportErrorsDiagnosticsRange.value.pos,
|
|
41668
|
+
insertEmitFilesAndReportErrorsDiagnosticsRange.value.end,
|
|
41669
|
+
`diagnostics: effectLspPatchUtils().extractDiagnosticsForExitStatus(${moduleName === "typescript" ? "module.exports" : "effectLspTypeScriptApis()"}, program, diagnostics, "${moduleName}")
|
|
41670
|
+
`,
|
|
41671
|
+
" ",
|
|
41672
|
+
version
|
|
41673
|
+
)
|
|
41674
|
+
);
|
|
41639
41675
|
let eofPos = sourceFile.text.lastIndexOf("// src/") - 1;
|
|
41640
41676
|
if (eofPos < 0) eofPos = sourceFile.text.length;
|
|
41641
41677
|
if (moduleName !== "typescript") {
|