private static @Nullable Project getProject(@NotNull Document document, @NotNull List<? extends Editor> editors) {
    for (Editor editor : editors) {
      Project project = editor.getProject();
      if (project != null) {
        return project;
      }
    }
    VirtualFile file = FileDocumentManager.getInstance().getFile(document);
    if (file != null) {
      try (AccessToken ignore = SlowOperations.knownIssue("IDEA-323372, EA-857522")) {
        return ProjectUtil.guessProjectForFile(file);
      }
    }
    return null;
  }
private static @Nullable Project getProject(@NotNull Document document, @NotNull List<? extends Editor> editors)