-
Notifications
You must be signed in to change notification settings - Fork 140
Description
We noticed in astral-sh/ruff#17463 (comment) that calling is_file_open degrades the durability of otherwise MEDIUM or HIGH durability queries to LOW because the Project::open_files_set and Project::files fields have durability LOW.
What this means is that we degrade the durability of type inference and semantic index queries to LOW if they have any type checking or semantic syntax errors. Which is unfortunate, because it requires that Salsa can't use the fast-path to mark the queries as "up-to-date" after a revision change.
To some extend, this problem is similar to the one we experienced in the module resolver where module resolution first tries first-party files (that have a low durability) and only then tests for third party files.
The easiest solution is to change is_file_open to early return for vendored paths and system paths that aren't subpaths of the project directory.