private void finishRedetectionIfEnqueued(@NotNull VirtualFile file) {
    ProgressManager.checkCanceled();
    boolean submitted;
    synchronized (filesToRedetect) {
      submitted = filesToRedetect.remove(file);
    }
    if (submitted) {
      try {
        reDetect(Collections.singleton(file));
      }
      catch (ProcessCanceledException e) {
        synchronized (filesToRedetect) {
          filesToRedetect.offer(file);
        }
        throw e;
      }
    }
  }
private void finishRedetectionIfEnqueued(@NotNull VirtualFile file)