Use file.modificationStamp to invalidate caches for synthetic files

It previously worked because of updating all counters. That behaviour was removed in
https://github.com/JetBrains/intellij-community/commit/3b860d69ee1b32b210ddf88b1e042dd70ea87cd9.

getUserData(FILE_OUT_OF_BLOCK_MODIFICATION_COUNT) is probably useless because copied file has
isEventSystemEnabled() == false that prevents sending notifications about PSI changes. This need additional checks.
This commit is contained in:
Nikolay Krasko
2016-06-24 14:20:13 +03:00
parent 67eca2cbb7
commit 8d055f6952
@@ -137,7 +137,8 @@ class KotlinCacheServiceImpl(val project: Project) : KotlinCacheService {
val syntheticFileModule = files.map { it.getModuleInfo() }.toSet().single()
val sdk = syntheticFileModule.sdk
val filesModificationTracker = ModificationTracker {
files.sumByLong { it.outOfBlockModificationCount }
// TODO: Check getUserData(FILE_OUT_OF_BLOCK_MODIFICATION_COUNT) actually works
files.sumByLong { it.outOfBlockModificationCount + it.modificationStamp }
}
val dependenciesForSyntheticFileCache = listOf(PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT, filesModificationTracker)
val debugName = "completion/highlighting in $syntheticFileModule for files ${files.joinToString { it.name }} for platform $targetPlatform"