Skip to content

[FEATURE]: Configure minimum LSP diagnostic severity level (show Warnings, not just Errors) #17869

Closed as not planned

Description

@KKdev15

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Summary

Allow users to configure the minimum severity level for LSP diagnostics shown to the AI agent. Currently, only Error (severity 1) diagnostics are displayed after file edits. Warning (severity 2) and lower severity diagnostics are silently filtered out, preventing the AI agent from seeing and acting on style violations and linting issues.

Problem

Many LSP servers report style guide violations, best practices, and linting issues as Warnings rather than Errors. Since OpenCode filters these out, the AI agent cannot:

  • Follow documentation and code style guides
  • Proactively fix linting issues
  • Ensure clean, consistent code

Example 1: ubCode LSP (Sphinx-Needs / ReStructuredText)

The ubCode LSP provides linting for .rst files and Sphinx-Needs directives. After configuring it in OpenCode:

{
  "lsp": {
    "ubcode": {
      "command": ["/path/to/ubcode-lsp/python", "-m", "ubcode_lsp.cli"],
      "extensions": [".rst"]
    }
  }
}

The LSP process starts and connects correctly (verified via ps aux), but no diagnostics are shown to the AI agent after editing .rst files—even when introducing obvious errors like malformed title underlines or unknown directives. This is because ubCode reports all issues as Warnings (severity 2).

Example 2: markdownlint-lsp

The markdownlint-lsp server reports all markdown style violations as Warnings by default. The only workaround is to manually patch the npm package source code.

In lib/server.mjs (line 477):

const diagnostic = Diagnostic.create(
  { /* range */ },
  `${issue.ruleDescription} (${issue.ruleNames.join("/")})`,
  DiagnosticSeverity.Warning,  // <-- Must manually change to .Error
  issue.ruleNames[0],
  "markdownlint",
);

This workaround is fragile and breaks on every package update.

Justification

AI agents should see all relevant diagnostics to:

  1. Follow style guides — Style violations are typically reported as warnings
  2. Write clean code — Agents can proactively fix issues before they accumulate
  3. Maintain consistency — Documentation style rules (RST, Markdown) are enforced via warnings
  4. Reduce manual review — Users shouldn't have to manually check for issues the LSP already detected

Proposed Solution

Add a configuration option to control the minimum severity level:

Option A: Global setting

{
  "lsp": {
    "minSeverity": 2 // 2 = warning
  }
}

Option B: Per-LSP setting

{
  "lsp": {
    "ubcode": {
      "command": ["..."],
      "extensions": [".rst"],
      "minSeverity": 2
    },
    "markdownlint": {
      "command": ["..."],
      "extensions": [".md"],
      "minSeverity": 2
    }
  }
}

Severity levels (per LSP spec)

Value Name Description
1 Error Current default (only these are shown)
2 Warning Style violations, linting issues
3 Information Informational messages
4 Hint Suggestions

Related Issues

Environment

  • OpenCode version: latest
  • OS: Linux (Ubuntu 22.04)
  • Affected LSP servers: ubCode, markdownlint-lsp, likely many others that report warnings

Activity

  1. added
    core
    on Mar 17, 2026
  2. KKdev15 commented on Mar 17, 2026

    @KKdev15
    Author

    Hi @rekram1-node,
    I already created a PR for this issue: #17877
    Looking forward to you feedback!
    Best regards,
    Kilian

  3. removed
    core
    on May 3, 2026
  4. parkuman commented on May 8, 2026

    @parkuman

    This would be helpful for the circleci-yaml-language-server as it surfaces useful diagnostics (like job definitions with no invocations) as warnings instead of errors.

  5. github-actions commented on Jul 9, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions