Skip to content

Add testbed reproducing diagnostic pull on a saved unsaved-but-named buffer#1798

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/diagnostics-requested-after-saving-buffer
Draft

Add testbed reproducing diagnostic pull on a saved unsaved-but-named buffer#1798
Copilot wants to merge 3 commits into
mainfrom
copilot/diagnostics-requested-after-saving-buffer

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Saving an "unsaved but named" (untitled:) buffer makes VS Code send didSave (file URI), then didChange/didClose followed by a textDocument/diagnostic request — all on the now-closed untitled: URI. A real server has no project for that URI and the request fails. This adds a minimal testbed to reproduce the flow (#1797 / #1771).

All changes are confined to the manual testbed/ extension and do not affect the library build or CI.

Changes

  • Fake language (testbed/package.json): registers a testbed language with the .testbed extension.
  • Client wiring (testbed/client/src/extension.ts): adds { language: 'testbed' } to documentSelector and .testbed to the diagnosticPullOptions.match filter.
  • Server (testbed/server/src/server.ts): logs didOpen/didSave/didClose and the diagnostic pull; fails the pull with no project found for URI <uri> when the target document is not open and its scheme is not file (the closed untitled: case), mirroring tsserver.
  • Repro assets: testbed/workspace/sample.testbed and testbed/workspace/repro-1797.md.

Server reproduction

if (document === undefined && uri.scheme !== 'file') {
    const message = `no project found for URI ${param.textDocument.uri}`;
    connection.console.error(`error handling method 'textDocument/diagnostic': ${message}`);
    throw new ResponseError(ErrorCodes.InvalidParams, message);
}

Exercising the built server over stdio with a diagnostic pull for a closed untitled: document surfaces:

error handling method 'textDocument/diagnostic': no project found for URI untitled:/.../newFile.testbed

Copilot AI changed the title [WIP] Add testbed for diagnostics issue with unsaved named buffer Add testbed reproducing diagnostic pull on a saved unsaved-but-named buffer Jun 22, 2026
Copilot AI requested a review from dbaeumer June 22, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants