Element element = getNameScope().lookup(node, getDefiningLibrary());
if (!(element instanceof VariableElement)) {
return null;
}
// Must be local or parameter.
ElementKind kind = element.getKind();
if (kind == ElementKind.LOCAL_VARIABLE) {
node.setStaticElement(element);
if (node.inSetterContext()) {
LocalVariableElementImpl variableImpl = (LocalVariableElementImpl) element;
variableImpl.markPotentiallyMutatedInScope();