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

Function resolveCppIncludePath

src/resolution/import-resolver.ts:1865–1878  ·  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

1863 * Called as a fallback after relative and aliased resolution fail.
1864 */
1865function resolveCppIncludePath(
1866 importPath: string,
1867 language: Language,
1868 context: ResolutionContext
1869): string | null {
1870 // (The search doesn't depend on the including file, and a project's files
1871 // include one header from hundreds of places.)
1872 let memo = cppIncludeSearches.get(context);
1873 if (!memo) cppIncludeSearches.set(context, (memo = new Map()));
1874 const key = `${language}\0${importPath}`;
1875 let found = memo.get(key);
1876 if (found === undefined) memo.set(key, (found = searchCppIncludeDirs(importPath, language, context)));
1877 return found;
1878}
1879
1880function searchCppIncludeDirs(
1881 importPath: string,

Callers 1

Calls 3

searchCppIncludeDirsFunction · 0.85
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected