MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / compareSites

Function compareSites

src/ui-server/api/program.ts:420–424  ·  view source on GitHub ↗

Source order: a call written inside another's arguments runs first; then by position.

(a: ProgramSite, b: ProgramSite)

Source from the content-addressed store, hash-verified

418
419/** Source order: a call written inside another's arguments runs first; then by position. */
420function compareSites(a: ProgramSite, b: ProgramSite): number {
421 if (inside(a.at, b.at)) return -1;
422 if (inside(b.at, a.at)) return 1;
423 return a.at.line - b.at.line || a.at.column - b.at.column;
424}
425
426function inside(x: ProgramSite['at'], y: ProgramSite['at']): boolean {
427 const afterStart = x.line > y.line || (x.line === y.line && x.column > y.column);

Callers

nothing calls this directly

Calls 1

insideFunction · 0.70

Tested by

no test coverage detected