Description
Describe the bug
The publishDiagnostics
messages don't contain the optional version
field as outlined in the spec. This field is useful for checking if diagnostics are still relevant (= their version
is the same as the document version). Sadly, it seems lua-language-server doesn't include this field.
Backstory: I'm writing a plugin for NeoVim to defer showing diagnostics until after a write. Since diagnostics may be received after a write (but belong to the document state from before the write), I check the version
field to see if the diagnostics should be displayed immediately, or if they should be set aside until the next write.
For lua-language-server this isn't possible due to the version
field being left out. This means that if you save a file super fast (or it takes lua-language-server longer to produce diagnostics) after making a change, not all diagnostics are displayed.
To Reproduce
- Produce diagnostics
- Note that the
version
field isn't included
Expected behavior
The version
field is included, and points to the version of the document at the time the diagnostics were produced.
Environment (please complete the following information):
- OS: Linux
- Client: NeoVim
- Version: 2.4.4