Remove unused parts
This commit is contained in:
-2
@@ -30,7 +30,6 @@ interface ScriptConfigurationCache {
|
||||
|
||||
fun setApplied(file: VirtualFile, configurationSnapshot: ScriptConfigurationSnapshot)
|
||||
fun setLoaded(file: VirtualFile, configurationSnapshot: ScriptConfigurationSnapshot)
|
||||
fun markOutOfDate(scope: ScriptConfigurationCacheScope)
|
||||
|
||||
fun allApplied(): Map<VirtualFile, ScriptCompilationConfigurationWrapper>
|
||||
fun clear()
|
||||
@@ -39,7 +38,6 @@ interface ScriptConfigurationCache {
|
||||
sealed class ScriptConfigurationCacheScope {
|
||||
object All : ScriptConfigurationCacheScope()
|
||||
class File(val file: KtFile) : ScriptConfigurationCacheScope()
|
||||
class Except(val file: KtFile) : ScriptConfigurationCacheScope()
|
||||
}
|
||||
|
||||
data class ScriptConfigurationState(
|
||||
|
||||
-33
@@ -36,29 +36,6 @@ open class ScriptConfigurationMemoryCache(
|
||||
memoryCache.put(file, old.copy(loaded = configurationSnapshot))
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
override fun markOutOfDate(scope: ScriptConfigurationCacheScope) {
|
||||
when (scope) {
|
||||
is ScriptConfigurationCacheScope.File -> {
|
||||
val file = scope.file.originalFile.virtualFile
|
||||
markFileOutOfDate(file)
|
||||
}
|
||||
is ScriptConfigurationCacheScope.Except -> {
|
||||
val file = scope.file.originalFile.virtualFile
|
||||
memoryCache.entrySet().forEach {
|
||||
if (it.key != file) {
|
||||
markFileOutOfDate(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
is ScriptConfigurationCacheScope.All ->{
|
||||
memoryCache.entrySet().forEach {
|
||||
markFileOutOfDate(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
override fun allApplied(): Map<VirtualFile, ScriptCompilationConfigurationWrapper> {
|
||||
@@ -76,14 +53,4 @@ open class ScriptConfigurationMemoryCache(
|
||||
memoryCache.clear()
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
private fun markFileOutOfDate(file: VirtualFile) {
|
||||
val old = memoryCache[file] ?: return
|
||||
memoryCache.put(
|
||||
file, old.copy(
|
||||
applied = old.applied?.copy(inputs = CachedConfigurationInputs.OutOfDate),
|
||||
loaded = old.loaded?.copy(inputs = CachedConfigurationInputs.OutOfDate)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
-5
@@ -24,11 +24,6 @@ interface ScriptConfigurationUpdater {
|
||||
*/
|
||||
fun ensureConfigurationUpToDate(files: List<KtFile>): Boolean
|
||||
|
||||
/**
|
||||
* Invalidate current configuration
|
||||
*/
|
||||
fun postponeConfigurationReload(scope: ScriptConfigurationCacheScope)
|
||||
|
||||
/**
|
||||
* Suggest to update script configuration if configuration for [file] is out of date
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user