diff --git a/platform/configuration-store-impl/src/StateStorageManagerImpl.kt b/platform/configuration-store-impl/src/StateStorageManagerImpl.kt index b0637a71579e..2fd9c23311b7 100644 --- a/platform/configuration-store-impl/src/StateStorageManagerImpl.kt +++ b/platform/configuration-store-impl/src/StateStorageManagerImpl.kt @@ -5,12 +5,8 @@ package com.intellij.configurationStore import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.components.* import com.intellij.openapi.components.StateStorageChooserEx.Resolution -import com.intellij.openapi.diagnostic.debug -import com.intellij.openapi.diagnostic.logger import com.intellij.openapi.roots.ProjectModelElement import com.intellij.openapi.util.io.FileUtilRt -import com.intellij.openapi.vfs.AsyncFileListener -import com.intellij.openapi.vfs.newvfs.events.VFileEvent import com.intellij.platform.settings.SettingsController import com.intellij.util.ReflectionUtil import com.intellij.util.SmartList @@ -383,22 +379,9 @@ fun removeMacroIfStartsWith(path: String, macro: String): String = path.removePr internal val Storage.path: String get() = value.ifEmpty { file } - @Internal data class Macro(@JvmField val key: String, @JvmField var value: Path) -private class MyAsyncVfsListener : AsyncFileListener { - override fun prepareChange(events: List): AsyncFileListener.ChangeApplier? { - LOG.debug { "Got a change in MyAsyncVfsListener: $events" } - service().schedule(events) - return null - } - - companion object { - private val LOG = logger() - } -} - private fun createDefaultVirtualTracker(componentManager: ComponentManager?): StorageVirtualFileTracker? { return if (componentManager == null) null else service() } diff --git a/platform/configuration-store-impl/src/StorageVirtualFileTracker.kt b/platform/configuration-store-impl/src/StorageVirtualFileTracker.kt index 78a365224f9a..b98243df790f 100644 --- a/platform/configuration-store-impl/src/StorageVirtualFileTracker.kt +++ b/platform/configuration-store-impl/src/StorageVirtualFileTracker.kt @@ -5,9 +5,11 @@ import com.intellij.openapi.components.Service import com.intellij.openapi.components.StateStorage import com.intellij.openapi.components.impl.stores.ComponentStorageUtil import com.intellij.openapi.components.impl.stores.IComponentStore +import com.intellij.openapi.components.service import com.intellij.openapi.components.stateStore import com.intellij.openapi.module.Module import com.intellij.openapi.project.Project +import com.intellij.openapi.vfs.AsyncFileListener import com.intellij.openapi.vfs.VfsUtil import com.intellij.openapi.vfs.VirtualFile import com.intellij.openapi.vfs.newvfs.events.* @@ -63,12 +65,10 @@ internal class StorageVirtualFileTracker { else { val path = event.path storage = filePathToStorage.get(path) - // We don't care about parent directory create (because it doesn't affect anything) - // and move (because it is not a supported case), - // but we should detect deletion - but again, it is not a supported case. - // So, we don't check if some of the registered storages located inside changed directory. - - // but if we have DirectoryBasedStorage, we check - if file located inside it + // We don't care about parent directory creation (because it doesn't affect anything) and move (because it is not a supported case), + // but we should detect deletion (though again, it is not a supported case). + // So, we don't check if some of the registered storages located inside changed directory, + // but if we have `DirectoryBasedStorage`, we check if a file is located inside it. if (storage == null && hasDirectoryBasedStorages && path.endsWith(ComponentStorageUtil.DEFAULT_EXT, ignoreCase = true)) { storage = filePathToStorage[VfsUtil.getParentDir(path)] } @@ -128,3 +128,10 @@ internal class StorageVirtualFileTracker { } } } + +private class StorageVfsListener : AsyncFileListener { + override fun prepareChange(events: List): AsyncFileListener.ChangeApplier? { + service().schedule(events) + return null + } +} diff --git a/platform/platform-resources/src/META-INF/PlatformExtensions.xml b/platform/platform-resources/src/META-INF/PlatformExtensions.xml index 29e64234161f..c64ce3e0d4b9 100644 --- a/platform/platform-resources/src/META-INF/PlatformExtensions.xml +++ b/platform/platform-resources/src/META-INF/PlatformExtensions.xml @@ -194,7 +194,7 @@ - +