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

Function matchLine

src/resolution/name-matcher.ts:1434–1449  ·  view source on GitHub ↗
(i: number)

Source from the content-addressed store, hash-verified

1432 : Math.max(0, enclosingScopeStartLine(ref, context) - 1);
1433
1434 const matchLine = (i: number): string | null => {
1435 const line = lines[i];
1436 if (!line) return null;
1437 // A generated/minified line (one multi-KB statement) is not something a
1438 // human-written local declaration lives on, and regexing it per ref is
1439 // pure waste — skip it rather than scan it.
1440 if (line.length > 10_000) return null;
1441 for (const re of patterns) {
1442 const m = line.match(re);
1443 if (m && m[1]) {
1444 const type = normalizeInferredTypeName(m[1]);
1445 if (type) return type;
1446 }
1447 }
1448 return null;
1449 };
1450
1451 // Incremental-scan memo (INFER_SCAN_STATES): this scan runs for EVERY
1452 // `receiver.method()` ref and was measured at 61µs/ref on kong (2.4s of

Callers 1

inferLocalReceiverTypeFunction · 0.85

Calls 1

Tested by

no test coverage detected