(tsconfigPath: string)
| 1594 | * @since 4.0.0 |
| 1595 | */ |
| 1596 | export function getProgram(tsconfigPath: string): ProgramCacheEntry { |
| 1597 | const cached = programCache.get(tsconfigPath) |
| 1598 | if (cached !== undefined) return cached |
| 1599 | const fileNames = new Set<string>() |
| 1600 | const result = collectTsConfigFiles(tsconfigPath, new Set(), fileNames) |
| 1601 | if (result.error !== undefined || result.parsed === undefined) { |
| 1602 | const entry = { error: result.error ?? `Unable to parse TypeScript config ${tsconfigPath}`, reported: false } |
| 1603 | programCache.set(tsconfigPath, entry) |
| 1604 | return entry |
| 1605 | } |
| 1606 | const program = ts.createProgram(Array.from(fileNames), result.parsed.options) |
| 1607 | const entry = { program, reported: false } |
| 1608 | programCache.set(tsconfigPath, entry) |
| 1609 | return entry |
| 1610 | } |
| 1611 | |
| 1612 | function resolveJSDocLinkSymbol( |
| 1613 | link: ts.JSDocLink, |
no test coverage detected