GrVariable (@Nullable GrExpression expression) { if (expression instanceof GrReferenceExpression ref) { final PsiElement resolved = ref.resolve(); if (PsiUtil.isLocalVariable(resolved)) { return (GrVariable)resolved; } return null; } return null; }