boolean (PsiElement patternNode, PsiElement matchedNode, @NotNull MatchContext context) { if (!(matchedNode instanceof PsiStatement) && !(matchedNode instanceof PsiComment)) { // typed statement matches statements (including block statements) and comments return false; } if (!(patternNode instanceof PsiExpressionStatement)) { return false; } final PsiExpression expression = ((PsiExpressionStatement)patternNode).getExpression(); return context.getMatcher().match(expression, matchedNode); }