public static void startListening() {
    Application app = ApplicationManager.getApplication();
    Disposer.register(app, AsyncEventSupport::ensureAllEventsProcessed);

    app.getMessageBus().simpleConnect().subscribe(VirtualFileManager.VFS_CHANGES, new BulkFileListener() {
      @Override
      public void before(@NotNull List<? extends @NotNull VFileEvent> events) {
        if (asyncProcessedEvents.contains(events)) {
          return;
        }
        List<AsyncFileListener.ChangeApplier> appliers = runAsyncListeners(events);
        AsyncEventSupport.appliers.put(events, appliers);
        beforeVfsChange(appliers);
      }

      @Override
      public void after(@NotNull List<? extends @NotNull VFileEvent> events) {
        if (asyncProcessedEvents.contains(events)) {
          return;
        }
        List<AsyncFileListener.ChangeApplier> appliers = AsyncEventSupport.appliers.remove(events);
        afterVfsChange(appliers);
      }
    });
  }
public static void startListening()