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

Function includeTarget

__tests__/sync-module-config-change.test.ts:122–127  ·  view source on GitHub ↗

What the first `#include` of `file` names.

(graph: CodeGraph, file: string)

Source from the content-addressed store, hash-verified

120
121/** What the first `#include` of `file` names. */
122function includeTarget(graph: CodeGraph, file: string): string[] {
123 return graph.getNodesInFile(file).filter((n) => n.kind === 'file')
124 .flatMap((n) => graph.getOutgoingEdges(n.id))
125 .filter((e) => e.kind === 'imports')
126 .map((e) => graph.getNode(e.target)!.filePath);
127}
128
129/** What a full index of C_BEFORE holds under a compile database naming `dir`, which names the folder it's in. */
130async function fullIndexWithDb(dir: string): Promise<string[]> {

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected