boolean (PsiFile f1, PsiFile f2) { if (f1 == null || f2 == null || f1 == f2) { return f1 == f2; } VirtualFile v1 = f1.getVirtualFile(); VirtualFile v2 = f2.getVirtualFile(); if (!(v1 instanceof VirtualFileWindow w1) || !(v2 instanceof VirtualFileWindow w2)) { return Objects.equals(v1, v2); } VirtualFile d1 = w1.getDelegate(); VirtualFile d2 = w2.getDelegate(); if (!Objects.equals(d1, d2)) { return false; } return Arrays.equals(w1.getDocumentWindow().getHostRanges(), w2.getDocumentWindow().getHostRanges()); }