LanguageServer.jl icon indicating copy to clipboard operation
LanguageServer.jl copied to clipboard

Diagnostics version is always 0

Open jwortmann opened this issue 1 year ago • 0 comments

Using the latest master branch (https://github.com/julia-vscode/LanguageServer.jl/tree/0da181a8e48da14c2ac46519311e01352c7c6fca) I noticed that the optional version property of the PublishDiagnosticsParams is always set to 0. As a result, the client likely rejects to update the diagnostics which are shown in the editor UI due to outdated document version. In other words the diagnostics from the state when a file was initially opened are shown in the editor, but after that they never change.

For example, the client sends textDocument/didChange like

{
    "textDocument": {
        "uri": "file:///D:/code/Julia/LspTest/main.jl",
        "version": 2
    },
    "contentChanges": ...
}

then the server sends textDocument/publishDiagnostics with

{
    "uri": "file:///d%3A/code/Julia/LspTest/main.jl",
    "version": 0,
    "diagnostics": ...
}

I assume this bug was introduced with the JuliaWorkspaces, and is perhaps caused by drive letter casing of URIs not being handled correctly (just a guess), because otherwise you would have very likely already noticed it in VSCode.

jwortmann avatar Sep 30 '24 12:09 jwortmann