private static void highlightResult(XmlElement contextNode, @NotNull final Editor editor, final List<?> list) {

        final Config cfg = XPathAppComponent.getInstance().getConfig();
        int lowestOffset = Integer.MAX_VALUE;

        for (final Object o : list) {
            LOG.assertTrue(o != null, "null element?");

            if (o instanceof PsiElement element) {

              if (element.getContainingFile() == contextNode.getContainingFile()) {
                    lowestOffset = highlightElement(editor, element, cfg, lowestOffset);
                }
            } else {
                LOG.info("Don't know what to do with " + o + " in a list context");
            }
            LOG.debug("o = " + o);
        }

        if (cfg.isScrollToFirst() && lowestOffset != Integer.MAX_VALUE) {
            editor.getScrollingModel().scrollTo(editor.offsetToLogicalPosition(lowestOffset), ScrollType.MAKE_VISIBLE);
            editor.getCaretModel().moveToOffset(lowestOffset);
        }

        SwingUtilities.invokeLater(() -> {
          final StatusBar statusBar = WindowManager.getInstance().getStatusBar(editor.getProject());
          statusBar.setInfo(XPathBundle.message("status.bar.text.xpath.choice.match.matches.found.press.escape.to.remove.highlighting",
                                                list.size(), list.size() == 1 ? 0 : 1));
        });
    }
private static void highlightResult(XmlElement contextNode, @NotNull final Editor editor, final List<?> list)