feat(opencode): add lsp_min_severity config option#17877
Open
KKdev15 wants to merge 1 commit intoanomalyco:devfrom
Open
feat(opencode): add lsp_min_severity config option#17877KKdev15 wants to merge 1 commit intoanomalyco:devfrom
KKdev15 wants to merge 1 commit intoanomalyco:devfrom
Conversation
1c3bf7d to
e42fc74
Compare
Add configurable minimum severity level for LSP diagnostics on a
per-LSP basis. This allows users to see warnings, info, and hints
from specific LSP servers, not just errors.
Example config:
{
"lsp": {
"markdownlint": {
"command": ["markdownlint-lsp"],
"extensions": [".md"],
"min_severity": 2
}
}
}
Closes anomalyco#17869
e42fc74 to
7cd1c5c
Compare
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Open
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #17869
Type of change
What does this PR do?
Adds a
min_severityconfig option per-LSP server to control the minimum diagnostic severity level shown to the AI agent.Currently, only Error (severity 1) diagnostics are displayed. Many LSP servers report style violations and linting issues as Warnings (severity 2), which are filtered out. This prevents the AI from seeing and fixing these issues.
With this change, users can configure each LSP to show warnings (or info/hints) by adding
min_severityto their LSP config:{ "lsp": { "markdownlint": { "command": ["markdownlint-lsp"], "extensions": [".md"], "min_severity": 2 } } }Severity levels: 1=Error (default), 2=Warning, 3=Info, 4=Hint.
Disclaimer: I would like to contribute this feature, as it's something I would really like to have! This MR was created only using AI. I'm not a TypeScript developer, so please be gentle on me :)
How did you verify your code works?
bun typecheck)test/lsp/min-severity.test.tswith 10 tests covering:min_severityper-LSPLSP.Diagnostic.filter()correctly filters by severity levelmin_severityset to 4. Afterwards ask opencode to remove empty lines after headings and show the LSP output with severity. Here's a screenshot of the output, which verifies, that the warning for no empty line around headings (MD022) is actually reported as warning and visible to opencode:("formatter": false)Screenshots / recordings
N/A - no UI changes
Checklist