void (@NotNull List<? extends @NotNull VFileEvent> events) { ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject); if (myForbid || !vcsManager.hasActiveVcss()) return; final FilesAndDirs dirtyFilesAndDirs = new FilesAndDirs(); // collect files and directories - sources of events for (VFileEvent event : events) { ProgressManager.checkCanceled(); final boolean isDirectory; if (event instanceof VFileCreateEvent) { if (!((VFileCreateEvent)event).getParent().isInLocalFileSystem()) { continue; } isDirectory = ((VFileCreateEvent)event).isDirectory(); } else { final VirtualFile file = Objects.requireNonNull(event.getFile(), "All events but VFileCreateEvent have @NotNull getFile()"); if (!file.isInLocalFileSystem()) { continue; } isDirectory = file.isDirectory(); } if (event instanceof VFileMoveEvent) { add(vcsManager, dirtyFilesAndDirs, VcsUtil.getFilePath(((VFileMoveEvent)event).getOldPath(), isDirectory)); add(vcsManager, dirtyFilesAndDirs, VcsUtil.getFilePath(((VFileMoveEvent)event).getNewPath(), isDirectory)); } else if (event instanceof VFilePropertyChangeEvent && ((VFilePropertyChangeEvent)event).isRename()) { // if a file was renamed, then the file is dirty and its parent directory is dirty too; // if a directory was renamed, all its children are recursively dirty, the parent dir is also dirty but not recursively. FilePath oldPath = VcsUtil.getFilePath(((VFilePropertyChangeEvent)event).getOldPath(), isDirectory); FilePath newPath = VcsUtil.getFilePath(((VFilePropertyChangeEvent)event).getNewPath(), isDirectory); // the file is dirty recursively, its old directory is dirty alone addWithParentDirectory(vcsManager, dirtyFilesAndDirs, oldPath); add(vcsManager, dirtyFilesAndDirs, newPath); } else { add(vcsManager, dirtyFilesAndDirs, VcsUtil.getFilePath(event.getPath(), isDirectory)); } } VcsDirtyScopeManagerImpl dirtyScopeManager = VcsDirtyScopeManagerImpl.getInstanceImpl(myProject); dirtyScopeManager.fileVcsPathsDirty(dirtyFilesAndDirs.files.asMap(), dirtyFilesAndDirs.dirs.asMap()); }