Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(oxlint/linter/lsp): apply bulk suppression baseline - #25093

Open
daniel-oliveira-figma wants to merge 34 commits into
oxc-project:mainfrom
daniel-oliveira-figma:feat/lsp-bulk-suppressions
Open

feat(oxlint/linter/lsp): apply bulk suppression baseline#25093
daniel-oliveira-figma wants to merge 34 commits into
oxc-project:mainfrom
daniel-oliveira-figma:feat/lsp-bulk-suppressions

Conversation

@daniel-oliveira-figma

@daniel-oliveira-figma daniel-oliveira-figma commented Jul 29, 2026

Copy link
Copy Markdown

Summary

Refs #21199 and follows the LSP decisions in #22198.

Teach the oxlint language server to apply oxlint-suppressions.json with the same count-based semantics as the CLI.

Suppressed diagnostics remain visible by default at warn severity. Clients can select hint, info, warn, or error, or hide suppressed diagnostics with suppressedViolationSeverity: "off".

Implementation

  • Refactor DiffManager to partition diagnostics into surfaced and suppressed groups without changing existing CLI behavior.
  • Load the single suppression baseline from the language-server workspace root, matching the CLI behavior and RFC decision.
  • Watch the workspace-root oxlint-suppressions.json so baseline changes rebuild the linter and refresh open documents.
  • Log malformed baselines and fail open so diagnostics remain visible. LSP client notification is deferred to draft follow-up feat(oxlint/lsp): report malformed suppression baselines #26543, pending feat(oxlint/lsp): show config errors to LSP client #25486.
  • Preserve existing fixes, code actions, related information, and inverted diagnostics for baselined diagnostics that remain visible.

Tests

Add coverage for:

  • suppressed diagnostics at every visible severity;
  • hiding suppressed diagnostics with off;
  • increased and decreased violation counts surfacing at original severity;
  • nested suppression files being ignored;
  • suppression state reloading after a watched-file change;
  • malformed baselines failing open;
  • related and inverted diagnostics for visible suppressed violations;
  • code actions remaining available on visible suppressed diagnostics.

Extension follow-up

This PR adds native language-server support and publishes suppressedViolationSeverity in the LSP configuration schema. The official oxc-vscode extension does not yet expose or forward this option, so a follow-up extension PR is required for users to customize it through VS Code settings. The default visible-warn behavior works without an extension change.

Verification

  • cargo run -q -p website_linter schema-markdown-lsp
  • INSTA_UPDATE=always cargo test -q -p website_linter test_schema_markdown_lsp (1 passed)
  • git diff upstream/main...HEAD --check

Full lint, build, typecheck, and test coverage is left to CI.

AI assistance

Codex was used to investigate, implement, test, and draft this change.

@daniel-oliveira-figma daniel-oliveira-figma changed the title feat(lsp): apply bulk suppression baseline feat(oxlint/linter/lsp): apply bulk suppression baseline Jul 29, 2026
@daniel-oliveira-figma
daniel-oliveira-figma marked this pull request as ready for review July 29, 2026 22:41
@Sysix Sysix added A-linter Area - Linter A-editor Area - Editor and Language Server labels Jul 30, 2026

@Sysix Sysix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the work ❤️
I had finally time to review the basic for LSP. I did not test it in a real editor, waiting for some team feedback, before manually testing it.

Comment thread apps/oxlint/src/lsp/options.rs Outdated
Comment thread apps/oxlint/src/lsp/options.rs Outdated
Comment thread apps/oxlint/src/lsp/options.rs
Comment thread apps/oxlint/src/lsp/server_linter.rs Outdated
Comment thread apps/oxlint/src/lsp/server_linter.rs Outdated
Comment thread crates/oxc_linter/src/suppression/diff.rs
Comment thread apps/oxlint/src/lsp/server_linter.rs Outdated
Comment thread apps/oxlint/src/lsp/server_linter.rs
Comment thread crates/oxc_linter/src/suppression/diff.rs
Comment thread apps/oxlint/test/lsp/utils.ts

@Sysix Sysix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small changes requested. Excited to test it in VSCode 🥳

Comment thread crates/oxc_linter/src/suppression/diff.rs
Comment thread crates/oxc_linter/src/suppression/mod.rs Outdated
Comment thread apps/oxlint/src/lsp/server_linter.rs Outdated
Comment thread apps/oxlint/src/lsp/server_linter.rs Outdated
Comment thread crates/oxc_linter/src/suppression/diff.rs
@daniel-oliveira-figma

Copy link
Copy Markdown
Author

🙏 thanks for the reviews @Sysix. I did some testing on vscode with a local build recently and it seemed to work as expected

@codspeed-hq

codspeed-hq Bot commented Sep 10, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 5 untouched benchmarks
⏩ 76 skipped benchmarks1


Comparing daniel-oliveira-figma:feat/lsp-bulk-suppressions (78bb033) with main (1aa5ec1)

Open in CodSpeed

Footnotes

  1. 76 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Sysix Sysix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the work. I could test it today with VSCode, everything looks good to me.
I added some commits, like hiding the LSP docs. The CLI does hide it currently too, we should align with CLI.

This now should align how @camchenry defined the implementation details in #22198 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-editor Area - Editor and Language Server A-linter Area - Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants