You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
@sumneko It seems that with the 2.5.1 release this is no longer working, as diagnostics are not including the version anymore. For example:
{
diagnostics = { {
code = "lowercase-global",
message = "Global variable in lowercase initial, Did you miss `local` or misspell it?",
range = {
end = {
character = 32,
line = 222
},
start = {
character = 9,
line = 222
}
},
severity = 3,
source = "Lua Diagnostics."
} },
uri = "file:///home/yorickpeterse/Projects/general/dotfiles/dotfiles/.config/nvim/lua/dotfiles/completion.lua"
}
Describe the bug
The
publishDiagnostics
messages don't contain the optionalversion
field as outlined in the spec. This field is useful for checking if diagnostics are still relevant (= theirversion
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
version
field isn't includedExpected 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):
The text was updated successfully, but these errors were encountered: