void setWatchRoots(@NotNull Supplier<CanonicalPathMap> pathMapSupplier) {
    Future<?> prevTask = myLastTask.getAndSet(myFileWatcherExecutor.submit(() -> {
      try {
        var pathMap = myShuttingDown ? CanonicalPathMap.empty() : pathMapSupplier.get();
        if (pathMap == null) return;
        myPathMap = pathMap;
        myManualWatchRoots = new ConcurrentHashMap<>();

        Pair<List<String>, List<String>> roots = pathMap.getCanonicalWatchRoots();
        PluggableFileWatcher.EP_NAME.forEachExtensionSafe(watcher -> {
          if (watcher.isOperational()) {
            watcher.setWatchRoots(roots.first, roots.second, myShuttingDown);
          }
        });
      }
      catch (RuntimeException | Error e) {
        LOG.error(e);
      }
    }));
    if (prevTask != null) {
      prevTask.cancel(false);
    }
  }
void setWatchRoots(@NotNull Supplier<CanonicalPathMap> pathMapSupplier)