diff --git a/platform/lang-impl/src/com/intellij/openapi/module/impl/moduleFileListener.kt b/platform/lang-impl/src/com/intellij/openapi/module/impl/moduleFileListener.kt index 8d827ae0879f..74c5d5b1c945 100644 --- a/platform/lang-impl/src/com/intellij/openapi/module/impl/moduleFileListener.kt +++ b/platform/lang-impl/src/com/intellij/openapi/module/impl/moduleFileListener.kt @@ -48,6 +48,7 @@ internal class ModuleFileListener(private val moduleManager: ModuleManagerCompon } val parentPath = event.file.parent?.path ?: return + var someModulePathIsChanged = false for (module in moduleManager.modules) { if (!module.isLoaded) { continue @@ -57,8 +58,13 @@ internal class ModuleFileListener(private val moduleManager: ModuleManagerCompon val moduleFilePath = module.moduleFilePath if (FileUtil.isAncestor(ancestorPath, moduleFilePath, true)) { setModuleFilePath(module, "$parentPath/${event.newValue}/${FileUtil.getRelativePath(ancestorPath, moduleFilePath, '/')}") + someModulePathIsChanged = true } } + + if (someModulePathIsChanged) { + moduleManager.incModificationCount() + } } private fun fileMoved(event: VFileMoveEvent) {