private static void addNavigationElements(Collection<? super PsiElement> array, PsiFile element) {
    StructureViewBuilder structureViewBuilder = LanguageStructureViewBuilder.getInstance().getStructureViewBuilder(element);
    if (structureViewBuilder instanceof TreeBasedStructureViewBuilder builder) {
      StructureViewModel model = builder.createStructureViewModel(null);
      try {
        addStructureViewElements(model.getRoot(), array, element);
      }
      finally {
        Disposer.dispose(model);
      }
    }
  }
private static void addNavigationElements(Collection<? super PsiElement> array, PsiFile element)