Skip to content

Diagnostic responses get returned separately from each LSP, overwriting each other in Eglot/FlymakeΒ #14

@jleechpe

Description

@jleechpe

I'm testing out using LSPX with python running lspx --lsp "pyright-langserver --stdio" --lsp "ty server" --lsp "ruff server".

I see all the ty type annotations but the diagnostic error/warning results being sent to flymake don't persist. When editing the buffer the following happens (assuming there are diagnostics to report):

  1. ty diagnostics show up very quickly for a very brief instant
  2. ruff diagnostics show up for a moment right afterwards, removing the ty diagnostics
  3. pyright diagnostics show up last, removing all the ty and ruff diagnostics to only leave their own.

This happens even if ruff and pyright return empty diagnostics and come in order of response speed. I added a (message "%S" diags) inside of the eglot diagnostic code for tracing and see them showing up sequentially with only their own diagnostics. Eglot has logic in place to clear all diagnostics when a new set comes in to avoid any stale diagnostics being left behind (in particular if they come from another file, but also since the diagnostics would only update their region otherwise). emacs-lsp/lsp-mode#2808 and joaotavora/eglot#1429 (reply in thread)

eglot is just seeing each return as a new set of diagnostics, which it is, rather than an addition to the existing ones, which technically it also is. Would there be a way to have lspx append subsequent diagnostics/responses for a given file changeset so that when they respond at different speeds you'd get ty then ty+ruff then ty+ruff+pyright (from the example above) as long as no new changes have been sent?

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