mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Script highlighting is on when `KotlinHighlightingUtils.shouldHighlightScript` returns `true`. Its value is cached (see [1]) and reset on modification trackers increment. `ScriptDependenciesModificationTracker` was missing but shouldn't as the one signaling about `ScriptConfiguration` availability (see conjunction [2] at [1]). More details on trackers There are two preconditions for scripting highlighting: indexing is over, and script-configuration is available. The first one is tracked via `ProjectRootModificationTracker`. It's triggered at [3]. The second - via `ScriptDependenciesModificationTracker`. It's incremented at [4]. On project opening from scratch (when indexing happens), we mostly rely on `ProjectRootModificationTracker`. But when the project is reopened, `ScriptDependenciesModificationTracker` comes into the scene. Why can we rely on its increment? The update at [4] is a snapshot containing all script dependencies roots [5]. --------------------------------------------------------------------------------------------------------- [1]: KotlinHighlightingUtils.shouldHighlightFile() [2]: ScriptConfigurationManager.getInstance(project).getConfiguration(this) != null [3]: ProjectRootManagerOnEndOfDumbModeIncrementer.exitDumbMode() [4]: ScriptClassRootsUpdater.doUpdate() [5]: ScriptClassRootsCache.FullUpdate.getHasNewRoots() GitOrigin-RevId: f19eb026fe36a59bf3a1af6f295b4fbd79088071