boolean (@NotNull Project project, Editor editor, PsiFile file) { if (!myReference.isValid()) { return false; } final PsiFile psiFile = myReference.getContainingFile(); assert psiFile != null; //noinspection ConstantValue -- rechecking of isValid is intended return myReference.isValid() && psiFile.isValid(); }