void () { if (!ourGlobalListenerInstalled.compareAndSet(false, true)) { return; } Topics.subscribe(VirtualFileManager.VFS_CHANGES, null, new BulkFileListener() { @Override public void before(@NotNull List<? extends @NotNull VFileEvent> events) { for (Project project : ProjectUtilCore.getOpenProjects()) { if (!project.isDisposed()) { project.getService(PsiVFSListener.class).before(events); } } } @Override public void after(@NotNull List<? extends @NotNull VFileEvent> events) { Project[] projects = ProjectUtilCore.getOpenProjects(); // let PushedFilePropertiesUpdater process all pending VFS events and update file properties before we issue PSI events for (Project project : projects) { PushedFilePropertiesUpdater updater = PushedFilePropertiesUpdater.getInstance(project); if (updater instanceof PushedFilePropertiesUpdaterImpl) { ((PushedFilePropertiesUpdaterImpl)updater).processAfterVfsChanges(events); } } for (Project project : projects) { project.getService(PsiVFSListener.class).after(events); } } }); }