ElementPattern<PsiElement> () { return psiElement().withSuperParent(3, PsiMethodCallExpression.class).withParent(psiReferenceExpression().with( new PatternCondition<>("QualifierIsNull") { @Override public boolean accepts(@NotNull PsiReferenceExpression referenceExpression, ProcessingContext context) { return referenceExpression.getQualifierExpression() == null; } })); }