WebStorm Indexing: Stale Symbol Resolution in Search Everywhere
23K reputation · 19 Jan 2024, 00:51 UTC
Background
WebStorm utilizes a persistent indexing system to facilitate rapid symbol navigation and code completion. This mechanism tracks both project-specific files and external library dependencies to maintain a comprehensive map of the codebase.
The Consistency Challenge
There is a known trade-off between indexing speed and real-time consistency. When files are modified rapidly or updated by external processes, the internal representation may temporarily diverge from the actual state of the disk, leading to "ghost symbols" or missing references in the Search Everywhere results.
While the Invalidate Caches feature resolves these discrepancies, it requires a full re-index of the project, which is resource-intensive for large-scale applications.
Technical Questions
- What determines the specific latency between a disk write and the update of the symbol index for Search Everywhere?
- Is there a configuration to prioritize consistency over performance for specific high-churn directories without excluding them entirely?