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

Function loadCppIncludeDirsFromCompileDB

src/resolution/import-resolver.ts:1794–1800  ·  view source on GitHub ↗
(projectRoot: string)

Source from the content-addressed store, hash-verified

1792 * fallback can run). Returns an array (possibly empty) otherwise.
1793 */
1794export function loadCppIncludeDirsFromCompileDB(projectRoot: string): string[] | null {
1795 for (const file of CPP_COMPILE_DB_FILES) {
1796 const dbPath = path.join(projectRoot, file);
1797 if (fs.statSync(dbPath, { throwIfNoEntry: false })?.isFile()) return readCompileDbIncludeDirs(dbPath, projectRoot);
1798 }
1799 return null;
1800}
1801
1802/** The include directories the compilation database at `dbPath` names; null when it can't be read. */
1803export function readCompileDbIncludeDirs(dbPath: string, projectRoot: string): string[] | null {

Callers 2

createContextMethod · 0.90
loadCppIncludeDirsFunction · 0.90

Calls 2

readCompileDbIncludeDirsFunction · 0.85
joinMethod · 0.45

Tested by 1

loadCppIncludeDirsFunction · 0.72