LSP diagnostics
Also called: publishDiagnostics, pull diagnostics
Diagnostics describe problems associated with a document, such as a syntax error or an unused variable. They carry ranges and messages, with optional information such as severity and codes. LSP 3.18 supports server-published diagnostics and a capability-dependent model in which the editor requests diagnostic reports.
In the publishing model, a new diagnostic list replaces the previous list for that document. If fixing a missing bracket removes the only error, the server sends an empty list to clear the editor’s marker. Sending nothing would leave the old report in place. This replacement rule matters when updates arrive repeatedly while someone types.
- Read first
- LSP document synchronization