@effect/language-service 0.72.1 → 0.73.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 +10 -0
- package/cli.js +20 -8
- package/cli.js.map +1 -1
- package/effect-lsp-patch-utils.js +19 -7
- package/effect-lsp-patch-utils.js.map +1 -1
- package/index.js +139 -77
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/transform.js +19 -7
- package/transform.js.map +1 -1
package/README.md
CHANGED
|
@@ -303,6 +303,16 @@ Effect.succeed(1); // This will not be reported as a floating Effect
|
|
|
303
303
|
Effect.succeed(1); // This will be reported as a floating effect
|
|
304
304
|
```
|
|
305
305
|
|
|
306
|
+
You can also use `*` as a wildcard to apply a severity to all diagnostics at once:
|
|
307
|
+
|
|
308
|
+
```ts
|
|
309
|
+
// @effect-diagnostics *:off
|
|
310
|
+
Effect.succeed(1); // No diagnostics will be reported from this point on
|
|
311
|
+
|
|
312
|
+
// @effect-diagnostics effect/floatingEffect:error
|
|
313
|
+
Effect.succeed(1); // This will be reported as a floating effect (rule-specific overrides wildcard)
|
|
314
|
+
```
|
|
315
|
+
|
|
306
316
|
or you can set the severity for the entire project in the global plugin configuration
|
|
307
317
|
|
|
308
318
|
```jsonc
|
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.
|
|
30217
|
+
version: "0.73.1",
|
|
30218
30218
|
publishConfig: {
|
|
30219
30219
|
access: "public",
|
|
30220
30220
|
directory: "dist"
|
|
@@ -32166,7 +32166,7 @@ var createDiagnosticExecutor = fn2("LSP.createCommentDirectivesProcessor")(
|
|
|
32166
32166
|
const lineOverrides = {};
|
|
32167
32167
|
const sectionOverrides = {};
|
|
32168
32168
|
const skippedRules = [];
|
|
32169
|
-
const regex = /@effect-diagnostics(-next-line)?((?:\s[a-zA-Z0-9/]
|
|
32169
|
+
const regex = /@effect-diagnostics(-next-line)?((?:\s(?:[a-zA-Z0-9/]+|\*):(?:off|warning|error|message|suggestion|skip-file))+)?/gm;
|
|
32170
32170
|
let match18;
|
|
32171
32171
|
while ((match18 = regex.exec(sourceFile.text)) !== null) {
|
|
32172
32172
|
const nextLineCaptureGroup = match18[1];
|
|
@@ -32215,8 +32215,10 @@ var createDiagnosticExecutor = fn2("LSP.createCommentDirectivesProcessor")(
|
|
|
32215
32215
|
const codeFixes = [];
|
|
32216
32216
|
const ruleNameLowered = rule.name.toLowerCase();
|
|
32217
32217
|
const defaultLevel = pluginOptions.diagnosticSeverity[ruleNameLowered] || rule.severity;
|
|
32218
|
-
if (skippedRules.indexOf(ruleNameLowered) > -1
|
|
32219
|
-
|
|
32218
|
+
if (skippedRules.indexOf(ruleNameLowered) > -1 || skippedRules.indexOf("*") > -1) {
|
|
32219
|
+
return { diagnostics: diagnostics3, codeFixes };
|
|
32220
|
+
}
|
|
32221
|
+
if (defaultLevel === "off" && (lineOverrides[ruleNameLowered] || sectionOverrides[ruleNameLowered] || lineOverrides["*"] || sectionOverrides["*"] || []).length === 0) {
|
|
32220
32222
|
return { diagnostics: diagnostics3, codeFixes };
|
|
32221
32223
|
}
|
|
32222
32224
|
const fixByDisableNextLine = (node) => ({
|
|
@@ -32265,14 +32267,22 @@ var createDiagnosticExecutor = fn2("LSP.createCommentDirectivesProcessor")(
|
|
|
32265
32267
|
const unusedLineOverrides = new Set(lineOverrides[ruleNameLowered] || []);
|
|
32266
32268
|
for (const emitted of applicableDiagnostics.slice(0)) {
|
|
32267
32269
|
let newLevel = defaultLevel;
|
|
32268
|
-
const
|
|
32270
|
+
const specificLineOverride = (lineOverrides[ruleNameLowered] || []).find(
|
|
32269
32271
|
(_) => _.pos < emitted.range.pos && _.end >= emitted.range.end
|
|
32270
32272
|
);
|
|
32273
|
+
const wildcardLineOverride = (lineOverrides["*"] || []).find(
|
|
32274
|
+
(_) => _.pos < emitted.range.pos && _.end >= emitted.range.end
|
|
32275
|
+
);
|
|
32276
|
+
const lineOverride = specificLineOverride && wildcardLineOverride ? specificLineOverride.pos >= wildcardLineOverride.pos ? specificLineOverride : wildcardLineOverride : specificLineOverride || wildcardLineOverride;
|
|
32271
32277
|
if (lineOverride) {
|
|
32272
32278
|
newLevel = lineOverride.level;
|
|
32273
32279
|
unusedLineOverrides.delete(lineOverride);
|
|
32274
32280
|
} else {
|
|
32275
|
-
const
|
|
32281
|
+
const specificSectionOverride = (sectionOverrides[ruleNameLowered] || []).find(
|
|
32282
|
+
(_) => _.pos < emitted.range.pos
|
|
32283
|
+
);
|
|
32284
|
+
const wildcardSectionOverride = (sectionOverrides["*"] || []).find((_) => _.pos < emitted.range.pos);
|
|
32285
|
+
const sectionOverride = specificSectionOverride && wildcardSectionOverride ? specificSectionOverride.pos >= wildcardSectionOverride.pos ? specificSectionOverride : wildcardSectionOverride : specificSectionOverride || wildcardSectionOverride;
|
|
32276
32286
|
if (sectionOverride) newLevel = sectionOverride.level;
|
|
32277
32287
|
}
|
|
32278
32288
|
if (!(newLevel in levelToDiagnosticCategory)) continue;
|
|
@@ -32796,7 +32806,9 @@ function make64(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
|
|
|
32796
32806
|
const sourceFile = program.getSourceFile(fileName);
|
|
32797
32807
|
if (!sourceFile) continue;
|
|
32798
32808
|
const resolvedPackages = getEffectRelatedPackages(sourceFile);
|
|
32799
|
-
|
|
32809
|
+
const effectPkgs = resolvedPackages["effect"];
|
|
32810
|
+
if (!effectPkgs) continue;
|
|
32811
|
+
for (const version of Object.keys(effectPkgs)) {
|
|
32800
32812
|
if (String(version).startsWith("4")) return "v4";
|
|
32801
32813
|
if (String(version).startsWith("3")) return "v3";
|
|
32802
32814
|
}
|
|
@@ -33203,7 +33215,7 @@ function make64(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
|
|
|
33203
33215
|
fn2("TypeParser.isEffectDataSourceFile")(function* (sourceFile) {
|
|
33204
33216
|
const moduleSymbol = typeChecker.getSymbolAtLocation(sourceFile);
|
|
33205
33217
|
if (!moduleSymbol) return yield* typeParserIssue("Node has no symbol", void 0, sourceFile);
|
|
33206
|
-
const taggedEnumSymbol = typeChecker.tryGetMemberInModuleExports("TaggedEnum", moduleSymbol);
|
|
33218
|
+
const taggedEnumSymbol = typeChecker.tryGetMemberInModuleExports("TaggedEnum", moduleSymbol) || typeChecker.tryGetMemberInModuleExports("taggedEnum", moduleSymbol);
|
|
33207
33219
|
if (!taggedEnumSymbol) return yield* typeParserIssue("TaggedEnum not found", void 0, sourceFile);
|
|
33208
33220
|
const taggedErrorSymbol = typeChecker.tryGetMemberInModuleExports("TaggedError", moduleSymbol);
|
|
33209
33221
|
if (!taggedErrorSymbol) return yield* typeParserIssue("TaggedError not found", void 0, sourceFile);
|