private static @Nullable PsiElement findFirstBreadcrumbedElement(final int offset,
                                                                   final VirtualFile file,
                                                                   final Project project,
                                                                   final BreadcrumbsProvider defaultInfoProvider,
                                                                   boolean checkSettings,
                                                                   boolean isSticky) {
    if (file == null || !file.isValid() || file.isDirectory()) return null;

    PriorityQueue<PsiElement> leafs =
      new PriorityQueue<>(3, (o1, o2) -> {
        TextRange range1 = o1.getTextRange();
        if (range1 == null) {
          LOG.error(o1 + " returned null range");
          return 1;
        }
        TextRange range2 = o2.getTextRange();
        if (range2 == null) {
          LOG.error(o2 + " returned null range");
          return -1;
        }
        return range2.getStartOffset() - range1.getStartOffset();
      });
    FileViewProvider viewProvider = BreadcrumbsUtilEx.findViewProvider(file, project);
    if (viewProvider == null) return null;

    for (final Language language : viewProvider.getLanguages()) {
      ContainerUtil.addIfNotNull(leafs, viewProvider.findElementAt(offset, language));
    }
    while (!leafs.isEmpty()) {
      final PsiElement element = leafs.remove();
      BreadcrumbsProvider provider = findProviderForElement(element, defaultInfoProvider, checkSettings);
      if (provider != null) {
        boolean accept = isSticky ? provider.acceptStickyElement(element) : provider.acceptElement(element);
        if (accept) {
          return element;
        }
      }
      if (!(element instanceof PsiFile)) {
        ContainerUtil.addIfNotNull(leafs, getParent(element, provider));
      }
    }
    return null;
  }
private static @Nullable PsiElement findFirstBreadcrumbedElement(final int offset,
                                                                   final VirtualFile file,
                                                                   final Project project,
                                                                   final BreadcrumbsProvider defaultInfoProvider,
                                                                   boolean checkSettings,
                                                                   boolean isSticky)