[Analysis API] Implement separate caching for unstable dangling files

PSI events do not arrive for dangling files with no backing
'VirtualFile', so its partial invalidation becomes non-trivial.
In the change, a short-living cache is implemented for these 'unstable'
dangling files.
This commit is contained in:
Yan Zhulanow
2023-11-15 16:18:31 +09:00
committed by Space Team
parent 9c91158be6
commit 6bbd252c07
6 changed files with 93 additions and 20 deletions
@@ -240,6 +240,13 @@ public interface KtDanglingFileModule : KtModule {
get() = "Temporary file"
}
/**
* True if the dangling file module supports partial invalidation on PSI modifications.
* Sessions for such modules can be cached for longer time.
*/
public val KtDanglingFileModule.isStable: Boolean
get() = file.isPhysical && file.viewProvider.isEventSystemEnabled
/**
* A set of sources which live outside the project content root. E.g, testdata files or source files of some other project.
*/