MCPcopy Create free account
hub / github.com/codeaashu/claude-code / getHighlighter

Function getHighlighter

web/components/tools/SyntaxHighlight.tsx:9–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7let highlighterPromise: Promise<Highlighter> | null = null;
8
9async 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
48const EXT_TO_LANG: Record<string, string> = {

Callers 1

useHighlightedCodeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected