@Override public void propertyChanged(@NotNull VirtualFilePropertyEvent event) { if (!isModuleAdded || event.getRequestor() instanceof StateStorage || !VirtualFile.PROP_NAME.equals(event.getPropertyName())) { return; } VirtualFile parent = event.getParent(); if (parent != null) { String parentPath = parent.getPath(); String ancestorPath = parentPath + "/" + event.getOldValue(); String moduleFilePath = getModuleFilePath(); if (VfsUtilCore.isAncestor(new File(ancestorPath), new File(moduleFilePath), true)) { setModuleFilePath( parentPath + "/" + event.getNewValue() + "/" + FileUtil.getRelativePath(ancestorPath, moduleFilePath, '/')); } } }