fix(reference-source): respect require bindings

Reuse lexical ownership to exclude shadowed require calls while retaining native CommonJS and direct createRequire bindings. Preserve candidate edges when JavaScript or TypeScript runtime mode is unknown.

Co-authored-by: Rudy Celekli <rudy@gradiahq.com>
This commit is contained in:
morlutoandRudy Celekli committed 2026-10-11 10:10:59 +08:00
1 parent f88c99021b
commit f998fcb1cc
5 files changed
+335 -4

No files matched your search

@@ -89,6 +89,10 @@ export const semanticScopeId = (
): string =>
`scope:${kind}:${String(node.start ?? -1)}:${String(node.end ?? -1)}`;
/** Create the canonical identity used by one binding in a lexical scope. */
export const semanticBindingId = (scopeId: string, name: string): string =>
`${scopeId}:binding:${encodeURIComponent(name)}`;
/** Resolve one lexical name from the scope containing a node. */
export const resolveSemanticBindingState = (
state: JavaScriptSemanticAnalysisState,