This is the start of an improved semantic analysis pass, reusing the ScopeManager added earlier in the stack but with new analysis built using the new visitor trait. The logic is a rough port of https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/hermes-eslint/src/scope-manager/referencer/Referencer.js Lots of bits are still missing, i'm starting with the parts that Forget needs.