pyright
pyright copied to clipboard
`pyright --watch` keeps reporting the diagnostics of a file that was deleted
Describe the bug
With pyright --watch, deleting a file that has a diagnostic does not remove the diagnostic. No new report is printed when the file is deleted, and every later report (after an edit of another file) still lists the deleted file with its error. A fresh pyright run does not list it. Expected: the report after the deletion no longer lists the file.
Code or Screenshots
pyrightconfig.json: {"include": ["src"]}
src/a.py: x: int = "A1"
src/b.py: y: int = "B1"
npx pyright --watch
# 2 errors (a.py, b.py). Then, in another terminal:
rm src/a.py
# no new report. Then:
printf 'y: int = "B3"\n' > src/b.py
# new report: still 2 errors, src/a.py:1:10 among them
npx pyright
# 1 error (b.py)
The same happens when the directory that holds the file is moved out of the project.
VS Code extension or command-line
Command line, pyright 1.1.414 (npm), Node.js 24.18.0, Linux 7.3 (Fedora 44).