Skip to content

Аfter file create/delete - request workspace/diagnostic with updated diagnostics are ignored by client #1647

@redexp

Description

@redexp

Hi,

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

  1. Implement workspace/diagnostic with response like IF file B.txt NOT exist THEN return one error ELSE return zero errors
  2. Open file A.txt - it should have one diagnostic error
  3. With Quick fix choose some action that should trigger codeAction/resolve
  4. On codeAction/resolve send response with
{edit: {
  documentChanges: [
    {kind: "create", uri: "file:///B.txt"},
    {
      textDocument: {uri: "file:///B.txt"},
      edits: [
        {
          range: {start: {line: 0, character: 0}, end: {line: 0, character: 0}},
          newText: "test"
        }
      ],
    },
  ]
}}
  1. workspace/diagnostic triggered and returned zero errors for A.txt
  2. File A.txt still has visible one error instead of zero errors
  3. Any edit of A.txt or B.txt clears errors form file A.txt

Versions

"vscode-languageclient": "^10.0.0-next.16"

VSCode

Version: 1.101.1
Commit: 18e3a1ec544e6907be1e944a94c496e302073435
Date: 2025-06-18T13:35:12.605Z
Electron: 35.5.1
ElectronBuildId: 11727614
Chromium: 134.0.6998.205
Node.js: 22.15.1
V8: 13.4.114.21-electron.0
OS: Linux x64 6.8.0-60-generic snap

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions