boolean (@NotNull Project project, Editor editor, PsiFile file) { PsiElement psiElement = myDescriptor.getPsiElement(); if (psiElement == null || !psiElement.isValid()) return false; PsiFile containingFile = psiElement.getContainingFile(); return containingFile == file || containingFile == null || containingFile.getViewProvider().getVirtualFile().equals(file.getViewProvider().getVirtualFile()); }