| 1731 | * fallback can run). Returns an array (possibly empty) otherwise. |
| 1732 | */ |
| 1733 | export 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. */ |
| 1742 | export function readCompileDbIncludeDirs(dbPath: string, projectRoot: string): string[] | null { |