From 4e01a68e2ad3cc2f021ce62f2fc8e2314431a26d Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 27 Feb 2017 14:24:49 +0100 Subject: [PATCH] IDEA-168764 modules.xml is not updated if module path is changed --- .../com/intellij/openapi/module/impl/moduleFileListener.kt | 6 ++++++ 1 file changed, 6 insertions(+) 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) {