boolean (@NotNull FileViewProvider view1, @NotNull FileViewProvider view2) { if (view1.getClass() != view2.getClass() || view1.getFileType() != view2.getFileType()) return false; Language baseLanguage = view1.getBaseLanguage(); if (baseLanguage != view2.getBaseLanguage()) return false; if (!view1.getLanguages().equals(view2.getLanguages())) return false; PsiFile psi1 = view1.getPsi(baseLanguage); PsiFile psi2 = view2.getPsi(baseLanguage); if (psi1 == null || psi2 == null) return psi1 == psi2; return psi1.getClass() == psi2.getClass(); }