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

Function resolveCppIncludePath

src/resolution/import-resolver.ts:2174–2187  ·  view source on GitHub ↗

* Resolve a C/C++ include path by searching include directories. * Called as a fallback after relative and aliased resolution fail.

(
  importPath: string,
  language: Language,
  context: ResolutionContext
)

Source from the content-addressed store, hash-verified

2172 * Called as a fallback after relative and aliased resolution fail.
2173 */
2174function resolveCppIncludePath(
2175 importPath: string,
2176 language: Language,
2177 context: ResolutionContext
2178): string | null {
2179 // (The search doesn't depend on the including file, and a project's files
2180 // include one header from hundreds of places.)
2181 let memo = cppIncludeSearches.get(context);
2182 if (!memo) cppIncludeSearches.set(context, (memo = new Map()));
2183 const key = `${language}\0${importPath}`;
2184 let found = memo.get(key);
2185 if (found === undefined) memo.set(key, (found = searchCppIncludeDirs(importPath, language, context)));
2186 return found;
2187}
2188
2189function searchCppIncludeDirs(
2190 importPath: string,

Callers 1

Calls 3

searchCppIncludeDirsFunction · 0.85
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected