mirror of
https://github.com/angular/angular.git
synced 2026-11-23 07:05:14 -05:00
Bundler integrations and workspace reconfigurations can change how module specifiers resolve without editing any individual source file—for example when alias tables, export conditions, or package layouts change between builds. While `invalidate_module_resolution` re-runs previously failed resolutions after file creation or deletion, callers also need a way to flush positive cached resolutions without discarding parsed ASTs. Add `ResolutionCache::clear_all` and `QueryEngine::clear_resolution_cache` to clear both host-internal and engine-level resolution caches and evict queries derived from any importer's resolutions while preserving cached `ParseFile` results. Expose `clear_resolution_cache` on `Analyzer`, `TestAnalyzer`, `WasmAnalyzer`, and the sidecar JSON-RPC server, returning the deduplicated list of stale module IDs while preserving virtual module IDs verbatim instead of normalizing backslashes. Surface `clearResolutionCache` on `IAnalyzer`, `WasmAnalyzer`, `NapiAnalyzer`, `SidecarAnalyzer`, and `HybridCompiler`. In `HybridCompiler`, sequence `clearResolutionCache` through the serialized update queue so evicted analyses are dropped from the TypeScript file cache, recorded for incremental emit, and refreshed on the following delta pass.