private static boolean isInActiveProject(@NotNull FileEditor editor) {
    ThreadingAssertions.assertEventDispatchThread();
    if (ProjectManager.getInstance().getOpenProjects().length <= 1 || ApplicationManager.getApplication().isUnitTestMode()) {
      return true;
    }
    // optimization: in the case of two or more projects, ignore projects which are not active at the moment, e.g., inside minimized windows
    // see IDEA-314543 Don't run LineMarkersPass on non-active(opened) projects
    // Can't just check the editor's window, though, because the active window might be something else, e.g. a detached Project View,
    // see IDEA-343992.
    Window editorWindow = SwingUtilities.getWindowAncestor(editor.getComponent());
    var editorProject = getProject(editorWindow);
    for (Window window : Window.getWindows()) {
      if (!window.isActive()) {
        continue;
      }
      if (window == editorWindow || getProject(window) == editorProject) {
        return true;
      }
    }
    // Project should be active in a headless case (see FL-25764)
    return editorWindow == null;
  }
private static boolean isInActiveProject(@NotNull FileEditor editor)