Skip to content

Bug/Feature Request: Allow configurable error reporting levels for partial LSP compatibility #1384

Closed

Description

@Zim-Inn

Description:

Currently, when a language server (e.g. Haskell Language Server) returns responses that include newer or partially unsupported LSP extensions (such as textDocument/inlayHint or importLens), LSP4IJ throws a ResponseErrorException and stops consuming the response. This behavior prevents the IDE plugin from continuing to provide other available services, even if most of the protocol is still compatible.

Problem:

  • Strict error handling causes the entire language server integration to fail when encountering one unsupported feature.
  • Users lose access to otherwise functional features (completion, diagnostics, hover, etc.).
  • This is especially problematic for fast-evolving language servers (e.g. HLS) that adopt new LSP extensions ahead of client support.

Proposal:
Introduce a configurable error reporting level in LSP4IJ, for example:

  • Strict (default): current behavior, fail on any protocol mismatch.
  • Warn: log the error, show a warning to the user, but continue consuming other responses.
  • Silent: ignore unsupported responses, continue with available features.

Benefits:

  • Improves resilience of LSP4IJ-based plugins against evolving language servers.
  • Allows users to continue working with partially compatible servers.
  • Provides flexibility for plugin developers and end users to choose the desired balance between strictness and usability.

Suggested Implementation:

  • Add a configuration option (e.g. in plugin settings or via API) to set error reporting level.
  • Wrap JSON-RPC response handling with a try/catch that respects the configured level.
  • Ensure warnings are logged in IDE event log for transparency.

Example Use Case:
With Haskell Language Server, importLens may fail due to rule mismatch, but other features (completion, diagnostics) remain usable. Under "Warn" mode, the plugin would log the error but continue providing those features.

Activity

  1. changed the title [-]Allow configurable error reporting levels for partial LSP compatibility[/-] [+]Bug/Feature Request: Allow configurable error reporting levels for partial LSP compatibility[/+] on Nov 29, 2025
  2. angelozerr commented on Nov 29, 2025

    @angelozerr
    Contributor

    To be honnest with you I dont understand your issue. LSP4IJ checks the server capability and if server has the proper server capabilty it consumes the lsp request.

    The ResponseErrorException is thrown when server throws an exception. It is not lsp4ij which throws this error.

    If some lsp feature like inlayHint fails it doesnt fail other lsp requests like completion, etc

  3. Zim-Inn commented on Nov 29, 2025

    @Zim-Inn
    Author

    some lsp feature like inlayHint fails it doesnt fail other lsp requests like completion, etc

    yes, i got it. i mean that it is huge noise in IDEA, because the error window pop up

  4. angelozerr commented on Nov 29, 2025

    @angelozerr
    Contributor

    By default you have a popup error but you can disable it, right?

  5. Zim-Inn commented on Nov 29, 2025

    @Zim-Inn
    Author
  6. angelozerr commented on Nov 29, 2025

    @angelozerr
    Contributor

    Could you explain me how to reproduce your issue please.

  7. Zim-Inn commented on Nov 29, 2025

    @Zim-Inn
    Author
  8. lagergren commented on Nov 2, 2026

    @lagergren
    Collaborator

    The levels this asks for exist: each language server has an Error reporting setting in its Debug tab, with None, In log and As notification (ErrorReportingKind), and LSP4IJ applies it to the errors of its LSP requests. None or In log silences a server's errors for the methods it only partly supports. If an error still pops up with None, a stack trace would show which path skips the setting.

  9. added a commit that references this issue on Nov 21, 2026
    004d644
  10. added this to the 0.30.2 milestone on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions