Skip to content

fix: prevent linting of deleted temp files#1681

Open
toscm wants to merge 1 commit intoREditorSupport:masterfrom
toscm:fix/lsp-ignore-deleted-temp-diagnostics
Open

fix: prevent linting of deleted temp files#1681
toscm wants to merge 1 commit intoREditorSupport:masterfrom
toscm:fix/lsp-ignore-deleted-temp-diagnostics

Conversation

@toscm
Copy link

@toscm toscm commented Feb 26, 2026

This PR fixes stale diagnostics being kept for temporary/deleted documents (for example git diff/revision views), which could accumulate in the 'Problems' panel as path[1]="": No such file or directory errors. See issue #1630 for details (including a video and screenshot).

Changes:

  • Drop diagnostics when the URI has an empty file path.
  • Drop diagnostics for unsupported URI schemes.
  • Drop diagnostics for file URIs that no longer exist.
  • Restrict single-server document selector to supported schemes only, e.g.:
    • file:///Users/me/project/script.R => selected and linted
    • untitled:Untitled-1 => selected and linted
    • vscode-notebook-cell:/... => selected and linted
    • git:/... (diff/revision temp document) => not selected
    • other temporary/non-standard schemes => not selected

Validation:

  • Reproduced with repeated open/click/close of git diff temporary revisions on my local machine (VSCode=1.109.5, R=4.5.2, MacOS=26.2, Model=MacBook Pro M2 Max)
  • Confirmed stale missing-path diagnostics no longer accumulate.
  • Confirmed real diagnostics for existing files are still shown correctly.
  • Packaged and installed VSIX for manual verification (available for download at toscm/vscode-R/releases/tag/v2.8.6-tempfix.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant