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
{{ message }}
Repository navigation
Аfter file create/delete - request workspace/diagnostic with updated diagnostics are ignored by client #1647
My language server (written on go, transport through stdio) implements the workspace/diagnostic request and returns a full set of diagnostics for all files in the workspace. This works correctly in most cases.
However, when a file is created or deleted (via LSP methods like codeAction/resolve, not a side effect), the editor does not seem to update diagnostics accordingly - it keeps showing outdated diagnostics. Despite my server responding with updated diagnostics for all files, the client seems to ignore them.
Steps
Implement workspace/diagnostic with response like IF file B.txt NOT exist THEN return one error ELSE return zero errors
Open file A.txt - it should have one diagnostic error
With Quick fix choose some action that should trigger codeAction/resolve
Dirk Bäumer (@dbaeumer) I wrote the condition IF file B.txt does NOT exist ... just to give a simple example. Actually, in my case, it's more like: IF some text exists in file B.txt THEN return zero errors ELSE return one error.
That’s why, in step 4, I didn’t just return "create" for the file but also specified "newText" for this new file. If I add the text manually anywhere in the workspace (including files created by the code action), then the response from workspace/diagnostic is handled correctly.
Sergii Kliuchnyk (@redexp) I assume you have A.txt open in the editor. If so the server should receive a pull diagnostic for the file. For open files the client always pulls for the file and the result overlays the one from workspace/diagnostics. This is to be able to show errors quicker in the UI.
And what is the value of interFileDependencies when you register for pull diagnostics.
Activity
dbaeumer commentedon Jun 26, 2025
Do you see the same behavior when creating the file
B.txtusing the explorer inside VS Code?redexp commentedon Jun 27, 2025
Dirk Bäumer (@dbaeumer) I wrote the condition
IF file B.txt does NOT exist ...just to give a simple example. Actually, in my case, it's more like:IF some text exists in file B.txt THEN return zero errors ELSE return one error.That’s why, in step 4, I didn’t just return "create" for the file but also specified "newText" for this new file. If I add the text manually anywhere in the workspace (including files created by the code action), then the response from workspace/diagnostic is handled correctly.
dbaeumer commentedon Dec 18, 2025
Sergii Kliuchnyk (@redexp) I assume you have A.txt open in the editor. If so the server should receive a pull diagnostic for the file. For open files the client always pulls for the file and the result overlays the one from
workspace/diagnostics. This is to be able to show errors quicker in the UI.And what is the value of
interFileDependencieswhen you register for pull diagnostics.