ASTNode (final ASTNode current) { ASTNode result = current; while (result != null) { PsiElement psi = result.getPsi(); if (psi instanceof PsiExpression && !(psi.getParent() instanceof PsiExpression)) { break; } result = result.getTreeParent(); } return result; }