StructureViewBuilder (@NotNull PsiFile psiFile, @NotNull Language language) { FileViewProvider viewProvider = psiFile.getViewProvider(); Language baseLanguage = viewProvider.getBaseLanguage(); PsiFile psi = viewProvider.getPsi(language); if (psi == null) return null; if (language == baseLanguage) return createMainBuilder(psi); PsiStructureViewFactory factory = LanguageStructureViewBuilder.INSTANCE.forLanguage(language); return factory == null ? null : factory.getStructureViewBuilder(psi); }