microsoft / microsoft/vscode-languageserver-node

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

Open
#1,647 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
1.8k
Forks
404
Avg merge
2d 8h
Merged PRs (30d)
14

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the sequence using workspace/diagnostic and codeAction/resolve with the supplied VS Code and vscode-languageclient versions. Trace how the client handles workspace diagnostics after documentChanges create or delete files; done means A.txt refreshes without editing A.txt or B.txt.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.