Skip to content

LspError.data missing #[serde(default)] swallows the real jdtls error #325

Open

Description

@sisyphusend

Summary

src/lsp.rs defines

pub struct LspError {
    code: i64,
    message: String,
    data: Value,   // no #[serde(default)]
}

LSP allows error.data to be omitted. When jdtls returns an error without data, the Error variant fails to deserialize, and since LspResponse is an untagged enum, the whole parse fails with:

Failed to parse response from LSP proxy: data did not match any variant of untagged enum LspResponse

Impact

The actual error message is swallowed. In our case the real response was:

{"error":{"code":-32601,"message":"No delegateCommandHandler for vscode.java.resolveMainClass"},"id":"...","jsonrpc":"2.0"}

but Zed surfaced the misleading serde error, which pointed everyone (including maintainers reading our report) at "protocol/proxy problems" instead of the broken debug plugin (see #324). This cost a long debugging session.

Repro

Fix

Add #[serde(default)] to data (one-liner) so the real message (No delegateCommandHandler ...) reaches the user.

Activity

  1. tartarughina commented on Nov 4, 2026

    @tartarughina
    Collaborator

    Thanks @sisyphusend for the deep dive. Did you by chance already applied the suggested fix and tested it?

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions