Is there an easy way to locate the AstNode associated to where a variable was defined?
Consumer(
builder: (context, ref) {
return Consumer(
builder: (context, ref) {},
);
},
);
Given a `MethodInvocation` on a "ref" object, I want to know which ref specifically was targeted, and I specifically need an AstNode (not an Element).
I want an AstNode, because I then want to visit the ancestors of that AstNode. In particular, I wish to look for enclosing InstanceCreationExpressions. And that information wouldn't be available with Elements.