@Nullable
  static ExtractableExpressionPart matchVariable(@NotNull PsiReferenceExpression expression, @Nullable List<? extends PsiElement> scope) {
    PsiElement resolved = expression.resolve();
    if (resolved instanceof PsiField && isModification(expression)) {
      return null;
    }
    if (resolved instanceof PsiVariable variable && (scope == null || !DuplicatesFinder.isUnder(resolved, scope))) {
      return new ExtractableExpressionPart(expression, variable, null, variable.getType());
    }
    return null;
  }
@Nullable
  static ExtractableExpressionPart matchVariable(@NotNull PsiReferenceExpression expression, @Nullable List<? extends PsiElement> scope)