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

Function loadCppIncludeDirsFromCompileDB

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

Source from the content-addressed store, hash-verified

1731 * fallback can run). Returns an array (possibly empty) otherwise.
1732 */
1733export function loadCppIncludeDirsFromCompileDB(projectRoot: string): string[] | null {
1734 for (const file of CPP_COMPILE_DB_FILES) {
1735 const dbPath = path.join(projectRoot, file);
1736 if (fs.statSync(dbPath, { throwIfNoEntry: false })?.isFile()) return readCompileDbIncludeDirs(dbPath, projectRoot);
1737 }
1738 return null;
1739}
1740
1741/** The include directories the compilation database at `dbPath` names; null when it can't be read. */
1742export 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