MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / orderedScope

Function orderedScope

graph-ui/src/pseudocode/pseudocode-builder.ts:431–444  ·  view source on GitHub ↗

* The scope's symbols, in the order their groups appear. * * For three of the four scopes that is the order the surface resolved them in, * because the surface is what knows how it found them: source order for a class, * selection order for a selection. For a closure it is the walk's own order,

(scope: PseudocodeScope, input: PseudocodeInput)

Source from the content-addressed store, hash-verified

429 * depend on which round trip won a race.
430 */
431function orderedScope(scope: PseudocodeScope, input: PseudocodeInput): ScopeEntry[] {
432 const byKey = new Map<string, SemanticIR>();
433 for (const ir of input.irs) {
434 byKey.set(identityOf(ir.symbol), ir);
435 }
436 if (scope.kind !== 'closure' || input.closure === undefined) {
437 return input.irs.map((ir) => ({ key: identityOf(ir.symbol), name: ir.symbol.name, ir }));
438 }
439 return input.closure.symbols.map((symbol) => ({
440 key: identityOf(symbol),
441 name: symbol.name,
442 ir: byKey.get(identityOf(symbol)),
443 }));
444}
445
446/** How many symbols the block is missing because a bound cut the walk short. */
447function hiddenSymbolsOf(scope: PseudocodeScope, input: PseudocodeInput): number {

Callers 1

buildPseudocodeFunction · 0.85

Calls 2

identityOfFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected