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

Function resolveCppIncludePath

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

1924 * Called as a fallback after relative and aliased resolution fail.
1925 */
1926function resolveCppIncludePath(
1927 importPath: string,
1928 language: Language,
1929 context: ResolutionContext
1930): string | null {
1931 // (The search doesn't depend on the including file, and a project's files
1932 // include one header from hundreds of places.)
1933 let memo = cppIncludeSearches.get(context);
1934 if (!memo) cppIncludeSearches.set(context, (memo = new Map()));
1935 const key = `${language}\0${importPath}`;
1936 let found = memo.get(key);
1937 if (found === undefined) memo.set(key, (found = searchCppIncludeDirs(importPath, language, context)));
1938 return found;
1939}
1940
1941function searchCppIncludeDirs(
1942 importPath: string,

Callers 1

Calls 3

searchCppIncludeDirsFunction · 0.85
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected