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

Function cppIncludeTargets

src/resolution/cpp-includers.ts:122–132  ·  view source on GitHub ↗
(context: ResolutionContext)

Source from the content-addressed store, hash-verified

120
121/** Every `#include` of the project, by its import node, as the indexed file it names (ProjectScans). */
122export function cppIncludeTargets(context: ResolutionContext): Map<string, string | null> {
123 const memo = memoFor(context);
124 const byName = includesByName(context, memo);
125 let count = 0;
126 for (const includes of byName.values()) count += includes.length;
127 if (count > INCLUDES_READ_UP_FRONT) return memo.targets;
128 for (const includes of byName.values()) {
129 for (const include of includes) includedFile(include, context, memo);
130 }
131 return memo.targets;
132}
133
134export function adoptCppIncludeTargets(context: ResolutionContext, targets: Map<string, string | null>): void {
135 memoFor(context).targets = targets;

Callers 2

readProjectScansFunction · 0.90

Calls 3

includesByNameFunction · 0.85
includedFileFunction · 0.85
memoForFunction · 0.70

Tested by

no test coverage detected