boolean (@NotNull Project project, Editor editor, @NotNull PsiElement element) { if (!element.isValid()) { return false; } // find java code up there, going through injections if necessary return findJavaCodeUpThere(element) != null; }