()
| 7 | let highlighterPromise: Promise<Highlighter> | null = null; |
| 8 | |
| 9 | async function getHighlighter(): Promise<Highlighter> { |
| 10 | if (!highlighterPromise) { |
| 11 | highlighterPromise = import("shiki").then((shiki) => |
| 12 | shiki.createHighlighter({ |
| 13 | themes: ["github-dark", "github-light"], |
| 14 | langs: [ |
| 15 | "typescript", |
| 16 | "javascript", |
| 17 | "tsx", |
| 18 | "jsx", |
| 19 | "python", |
| 20 | "rust", |
| 21 | "go", |
| 22 | "java", |
| 23 | "c", |
| 24 | "cpp", |
| 25 | "ruby", |
| 26 | "shell", |
| 27 | "bash", |
| 28 | "json", |
| 29 | "yaml", |
| 30 | "toml", |
| 31 | "css", |
| 32 | "html", |
| 33 | "markdown", |
| 34 | "sql", |
| 35 | "dockerfile", |
| 36 | "kotlin", |
| 37 | "swift", |
| 38 | "php", |
| 39 | "xml", |
| 40 | ], |
| 41 | }) |
| 42 | ); |
| 43 | } |
| 44 | return highlighterPromise; |
| 45 | } |
| 46 | |
| 47 | // Map file extension to shiki language |
| 48 | const EXT_TO_LANG: Record<string, string> = { |
no outgoing calls
no test coverage detected