gradle.kts: add clearCaches method for testing

This commit is contained in:
Sergey Rostov
2019-12-04 15:04:12 +03:00
parent 559b067f91
commit fd16078a34
2 changed files with 11 additions and 0 deletions
@@ -160,5 +160,10 @@ interface ScriptConfigurationManager {
fun updateScriptDependenciesSynchronously(file: PsiFile, project: Project) {
(getInstance(project) as AbstractScriptConfigurationManager).updateScriptDependenciesSynchronously(file)
}
@TestOnly
fun clearCaches(project: Project) {
(getInstance(project) as AbstractScriptConfigurationManager).clearCaches()
}
}
}
@@ -222,6 +222,7 @@ internal abstract class AbstractScriptConfigurationManager(
override fun clearConfigurationCachesAndRehighlight() {
ScriptDependenciesModificationTracker.getInstance(project).incModificationCount()
// todo: cache.clear()
clearClassRootsCaches()
if (project.isOpen) {
@@ -230,6 +231,11 @@ internal abstract class AbstractScriptConfigurationManager(
}
}
@TestOnly
internal fun clearCaches() {
cache.clear()
}
private fun updateHighlighting(files: List<VirtualFile>) {
if (files.isEmpty()) return