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

Method getNodesByFileAndName

src/db/queries.ts:1318–1326  ·  view source on GitHub ↗

The nodes of a file with one name, in getNodesByFile order, decoding only those rows.

(filePath: string, name: string)

Source from the content-addressed store, hash-verified

1316
1317 /** The nodes of a file with one name, in {@link getNodesByFile} order, decoding only those rows. */
1318 getNodesByFileAndName(filePath: string, name: string): Node[] {
1319 if (!this.stmts.getNodesByFileAndName) {
1320 this.stmts.getNodesByFileAndName = prepareNodeStatement(
1321 this.db,
1322 'SELECT * FROM nodes WHERE file_path = ? AND name = ? ORDER BY start_line, id'
1323 );
1324 }
1325 return this.stmts.getNodesByFileAndName.all(filePath, name);
1326 }
1327
1328 /**
1329 * Get all nodes in a file

Callers 1

createContextMethod · 0.80

Calls 2

prepareNodeStatementFunction · 0.85
allMethod · 0.65

Tested by

no test coverage detected