mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-20 00:11:37 +00:00
docs(scope-resolution): refresh comments after dropping duplicated indexes
Replace references to the now-deleted `memberByOwner` / `callablesBySimpleName` index fields with comments that describe the actual lookup path (`SemanticModel` registries + scope-tied module bindings). Pure doc cleanup; no behavior change.
This commit is contained in:
parent
4b608f8e53
commit
c6c027a8d9
2 changed files with 11 additions and 9 deletions
|
|
@ -172,11 +172,11 @@ export function runScopeResolution(
|
|||
methodDispatch: buildPopulatedMethodDispatch(mroByClassDefId),
|
||||
};
|
||||
|
||||
// Build the workspace resolution index ONCE — turns every
|
||||
// findOwnedMember / findExportedDef / classScopeByDefId lookup in
|
||||
// the downstream passes from O(N×D) to O(1). Must run AFTER
|
||||
// populateOwners (so memberByOwner is correct) and AFTER
|
||||
// finalize (so module-scope bindings are available).
|
||||
// Build the workspace resolution index ONCE — scope-valued lookups
|
||||
// (`classScopeByDefId`, `moduleScopeByFile`) that `SemanticModel`
|
||||
// cannot carry. Must run AFTER `populateOwners` (so owned defs are
|
||||
// attributed correctly) and AFTER finalize (so module-scope
|
||||
// bindings are available).
|
||||
const workspaceIndex = buildWorkspaceResolutionIndex(parsedFiles);
|
||||
|
||||
// Cross-file implicit-namespace visibility (C#). Must run before
|
||||
|
|
|
|||
|
|
@ -292,10 +292,12 @@ export function findExportedDefByName(
|
|||
}
|
||||
// Workspace-wide fallback: iterate every file's Module scope (via
|
||||
// the scope-tied `moduleScopeByFile` lookup) and return the first
|
||||
// locally-declared callable binding matching `name`. Mirrors the
|
||||
// original `callablesBySimpleName[0]` semantics — first-seen-by-
|
||||
// file wins, bindings filtered to `origin === 'local'` and the
|
||||
// callable types Function/Method/Constructor.
|
||||
// locally-declared callable binding matching `name`. First-seen-
|
||||
// by-file wins; bindings filtered to `origin === 'local'` and the
|
||||
// callable types Function/Method/Constructor. We walk scopes here
|
||||
// rather than consult `SemanticModel.symbols.lookupCallableByName`
|
||||
// because the `origin === 'local'` module-export-visibility filter
|
||||
// is a scope concept the raw symbol index doesn't express.
|
||||
for (const [, moduleScope] of index.moduleScopeByFile) {
|
||||
const refs = moduleScope.bindings.get(name);
|
||||
if (refs === undefined) continue;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue