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

Method getTopLevelSignaturesMentioning

src/db/queries.ts:1675–1682  ·  view source on GitHub ↗

* The `signature` of each top-level node of these kinds and languages whose * text holds one of `names`. A sync asks this about the definitions it changed, * so no node is built and nothing is sorted; `names` is the caller's to keep short.

(kinds: readonly NodeKind[], languages: readonly string[], names: readonly string[])

Source from the content-addressed store, hash-verified

1673 * so no node is built and nothing is sorted; `names` is the caller's to keep short.
1674 */
1675 getTopLevelSignaturesMentioning(kinds: readonly NodeKind[], languages: readonly string[], names: readonly string[]): string[] {
1676 const marks = (n: number): string => new Array(n).fill('?').join(', ');
1677 const rows = this.db.prepare(
1678 `SELECT signature FROM nodes WHERE kind IN (${marks(kinds.length)}) AND language IN (${marks(languages.length)})
1679 AND qualified_name = name AND (${names.map(() => 'instr(signature, ?) > 0').join(' OR ')})`
1680 ).all(...kinds, ...languages, ...names) as Array<{ signature: string }>;
1681 return rows.map((row) => row.signature);
1682 }
1683
1684 /**
1685 * Get all nodes in the database

Callers 1

aliasMayNameFunction · 0.80

Calls 4

mapMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected