private static void installGlobalListener() {
    if (!ourGlobalListenerInstalled.compareAndSet(false, true)) {
      return;
    }

    ApplicationManager.getApplication().getMessageBus().simpleConnect().subscribe(VirtualFileManager.VFS_CHANGES, 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);
        }
      }
    });
  }
private static void installGlobalListener()