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