private static @Nullable PsiLocalVariable getVariable(@NotNull PsiElement anchor) {
    if (anchor.getParent() instanceof PsiReferenceExpression && anchor.getParent().getParent() instanceof PsiCallExpression) {
      anchor = ((PsiReferenceExpression)anchor.getParent()).getQualifierExpression();
    }
    if (!(anchor instanceof PsiExpression)) return null;
    return ExpressionUtils.resolveLocalVariable((PsiExpression)anchor);
  }
private static @Nullable PsiLocalVariable getVariable(@NotNull PsiElement anchor)