BulkFileListener (@NotNull ContentDiffRequest request) { final List<VirtualFile> files = new ArrayList<>(0); for (DiffContent content : request.getContents()) { if (content instanceof FileContent && !(content instanceof DocumentContent)) { files.add(((FileContent)content).getFile()); } } if (files.isEmpty()) return null; return new BulkFileListener() { @Override public void after(@NotNull List<? extends @NotNull VFileEvent> events) { for (VFileEvent event : events) { if (event instanceof VFileContentChangeEvent || event instanceof VFilePropertyChangeEvent) { VirtualFile file = Objects.requireNonNull(event.getFile()); if (files.contains(file)) { onFileChange(file); } } } } }; }