-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Is your feature request related to a problem? Please describe.
When pyright is used as a language server by AI coding tools, stale diagnostics cause problems. The tool edits a file via textDocument/didChange, then reads diagnostics to decide what to do next. Because reanalysis is async, the diagnostics it reads are from the previous state. This causes the tool to re-fix already-fixed errors, miss newly introduced errors, or loop on diagnostics that no longer apply.
This isn't a problem for interactive editors where a human is still typing and the debounce is desirable.
Describe the solution you'd like
An opt-in setting (pyright.eagerDiagnosticInvalidation, default false) that publishes empty diagnostics for a file immediately on didChange, before reanalysis completes. No behavior change for anyone who doesn't enable it.
The setting would be configured by tool vendors in their LSP initialization config, not by end users.
I have a working implementation with tests if there's interest.