public List<PsiReferenceExpression> getVariableReferences(@NotNull PsiVariable variable, @Nullable PsiElement context) {
    Collection<PsiReference> references = myLocalRefsMap.get(variable.getNavigationElement());
    if (references.isEmpty()) return List.of();
    List<PsiReferenceExpression> result = new ArrayList<>();
    for (PsiReference reference : references) {
      if (reference.getElement() instanceof PsiReferenceExpression ref) {
        if (context == null || PsiTreeUtil.isAncestor(context, ref, false)) {
          result.add(ref);
        }
      }
    }
    return result;
  }
public List<PsiReferenceExpression> getVariableReferences(@NotNull PsiVariable variable, @Nullable PsiElement context)