IDEA-168764 modules.xml is not updated if module path is changed

This commit is contained in:
Vladimir Krivosheev
2017-02-27 14:26:04 +01:00
parent a20fcce5bc
commit 4e01a68e2a
@@ -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) {