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
Opening or closing an unsaved dependency leaves stale diagnostics after a large file-watch batch #65638
typescript@7.1.0-dev.20261123.1 (01f1a75), macOS 27.2.1 arm64. Tested with an LSP client against tsc --lsp --stdio.
User Goal
An editor showed an error that referred to an older version of an imported file. I wanted to check whether the stock TypeScript language server updates the importer when a dependency opens with unsaved text or closes without saving.
Setup and Action
// main.tsimport{value}from"./dep"exportconstcount: number=value// dep.ts on diskexportconstvalue: string="disk"
Initialize the server with pull diagnostics and dynamic file-watch registration enabled. Open main.ts and pull its diagnostics. It reports TS2322.
Send a single workspace/didChangeWatchedFiles notification with 1,001 changed paths outside the program. Then open dep.ts with the in-memory text export const value: number = 1 and immediately pull diagnostics for main.ts. The notifications below use standard LSP parameter shapes, with rootUri set to the project directory.
To test closing, start a fresh session. Open both files with the in-memory text above and pull diagnostics for main.ts (none). Send the same watch notification, close dep.ts without saving, then pull diagnostics for main.ts again.
Expected and Actual Behavior
Action
Expected diagnostic on main.ts
999 changed paths
1,001 changed paths
Open the unsaved numeric version
None
None
TS2322
Close it and return to the string on disk
TS2322
TS2322
None
Both results repeated in three fresh runs. The watched paths and the content on disk were the same for the open and close tests at each batch size.
Agent Info
Codex desktop (26.1117.41037), GPT-6, TypeScript Report Issue Skill Version 1.0.
Activity