List<Module> (@NotNull List<? extends VFileEvent> events) { final List<Module> modulesToBeMarkedDirty = new ArrayList<>(); for (VFileEvent event : events) { ProgressManager.checkCanceled(); if (event instanceof VFileDeleteEvent || event instanceof VFileMoveEvent || event instanceof VFileContentChangeEvent) { VirtualFile file = event.getFile(); assert file != null; final Module module = getModuleForSourceContentFile(file); ContainerUtil.addIfNotNull(modulesToBeMarkedDirty, module); } else if (event instanceof VFilePropertyChangeEvent pce) { String propertyName = pce.getPropertyName(); if (VirtualFile.PROP_NAME.equals(propertyName) || VirtualFile.PROP_SYMLINK_TARGET.equals(propertyName)) { final String path = pce.getFile().getPath(); for (Module module : ModuleManager.getInstance(myProject).getModules()) { if (FileUtil.isAncestor(path, module.getModuleFilePath(), true)) { modulesToBeMarkedDirty.add(module); } } } } } return modulesToBeMarkedDirty; }