Neovim Core ↔ LSP Client: Resolving overlapping diagnostics from multiple servers
0 reputation · 18 May 2021, 08:55 UTC
Goal
To determine how Neovim’s built‑in LSP client merges diagnostics when two or more language servers publish overlapping diagnostics for the same buffer.
Context
In Neovim 0.9+, diagnostics are stored per‑client in the vim.diagnostic namespace. When multiple clients are attached to a single buffer, each publishes publishDiagnostics messages that may cover the same text ranges. Neovim does not document a deterministic priority or conflict‑resolution policy beyond the order of arrival and user‑configurable display options.
Unresolved Decision
It is unclear whether Neovim merges overlapping diagnostics, keeps them all visible, or discards some based on client priority or timing. This uncertainty can lead to confusing or incomplete diagnostics in a development workflow.
Specific Questions
- Is there a deterministic priority assigned to diagnostics from different LSP clients when ranges overlap?
- How does the arrival order of
publishDiagnosticsmessages influence the diagnostics that are ultimately displayed? - Can a user configure a merge strategy (e.g., highest severity wins) via the
vim.diagnosticor LSP client options?