@effect/language-service 0.73.0 → 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 +16 -6
- package/cli.js.map +1 -1
- package/effect-lsp-patch-utils.js +15 -5
- package/effect-lsp-patch-utils.js.map +1 -1
- package/index.js +15 -5
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/transform.js +15 -5
- package/transform.js.map +1 -1
package/index.js
CHANGED
|
@@ -4247,7 +4247,7 @@ var createDiagnosticExecutor = fn("LSP.createCommentDirectivesProcessor")(
|
|
|
4247
4247
|
const lineOverrides = {};
|
|
4248
4248
|
const sectionOverrides = {};
|
|
4249
4249
|
const skippedRules = [];
|
|
4250
|
-
const regex = /@effect-diagnostics(-next-line)?((?:\s[a-zA-Z0-9/]
|
|
4250
|
+
const regex = /@effect-diagnostics(-next-line)?((?:\s(?:[a-zA-Z0-9/]+|\*):(?:off|warning|error|message|suggestion|skip-file))+)?/gm;
|
|
4251
4251
|
let match3;
|
|
4252
4252
|
while ((match3 = regex.exec(sourceFile.text)) !== null) {
|
|
4253
4253
|
const nextLineCaptureGroup = match3[1];
|
|
@@ -4296,8 +4296,10 @@ var createDiagnosticExecutor = fn("LSP.createCommentDirectivesProcessor")(
|
|
|
4296
4296
|
const codeFixes = [];
|
|
4297
4297
|
const ruleNameLowered = rule.name.toLowerCase();
|
|
4298
4298
|
const defaultLevel = pluginOptions.diagnosticSeverity[ruleNameLowered] || rule.severity;
|
|
4299
|
-
if (skippedRules.indexOf(ruleNameLowered) > -1
|
|
4300
|
-
|
|
4299
|
+
if (skippedRules.indexOf(ruleNameLowered) > -1 || skippedRules.indexOf("*") > -1) {
|
|
4300
|
+
return { diagnostics: diagnostics2, codeFixes };
|
|
4301
|
+
}
|
|
4302
|
+
if (defaultLevel === "off" && (lineOverrides[ruleNameLowered] || sectionOverrides[ruleNameLowered] || lineOverrides["*"] || sectionOverrides["*"] || []).length === 0) {
|
|
4301
4303
|
return { diagnostics: diagnostics2, codeFixes };
|
|
4302
4304
|
}
|
|
4303
4305
|
const fixByDisableNextLine = (node) => ({
|
|
@@ -4346,14 +4348,22 @@ var createDiagnosticExecutor = fn("LSP.createCommentDirectivesProcessor")(
|
|
|
4346
4348
|
const unusedLineOverrides = new Set(lineOverrides[ruleNameLowered] || []);
|
|
4347
4349
|
for (const emitted of applicableDiagnostics.slice(0)) {
|
|
4348
4350
|
let newLevel = defaultLevel;
|
|
4349
|
-
const
|
|
4351
|
+
const specificLineOverride = (lineOverrides[ruleNameLowered] || []).find(
|
|
4350
4352
|
(_) => _.pos < emitted.range.pos && _.end >= emitted.range.end
|
|
4351
4353
|
);
|
|
4354
|
+
const wildcardLineOverride = (lineOverrides["*"] || []).find(
|
|
4355
|
+
(_) => _.pos < emitted.range.pos && _.end >= emitted.range.end
|
|
4356
|
+
);
|
|
4357
|
+
const lineOverride = specificLineOverride && wildcardLineOverride ? specificLineOverride.pos >= wildcardLineOverride.pos ? specificLineOverride : wildcardLineOverride : specificLineOverride || wildcardLineOverride;
|
|
4352
4358
|
if (lineOverride) {
|
|
4353
4359
|
newLevel = lineOverride.level;
|
|
4354
4360
|
unusedLineOverrides.delete(lineOverride);
|
|
4355
4361
|
} else {
|
|
4356
|
-
const
|
|
4362
|
+
const specificSectionOverride = (sectionOverrides[ruleNameLowered] || []).find(
|
|
4363
|
+
(_) => _.pos < emitted.range.pos
|
|
4364
|
+
);
|
|
4365
|
+
const wildcardSectionOverride = (sectionOverrides["*"] || []).find((_) => _.pos < emitted.range.pos);
|
|
4366
|
+
const sectionOverride = specificSectionOverride && wildcardSectionOverride ? specificSectionOverride.pos >= wildcardSectionOverride.pos ? specificSectionOverride : wildcardSectionOverride : specificSectionOverride || wildcardSectionOverride;
|
|
4357
4367
|
if (sectionOverride) newLevel = sectionOverride.level;
|
|
4358
4368
|
}
|
|
4359
4369
|
if (!(newLevel in levelToDiagnosticCategory)) continue;
|