xonecas.io
70160
Ce

cel-tui / commit 700e738

feat: add diff to clew languages

xonecas2026-04-26 700e738dad51e0b452fb1c4bcfeff9612bbd1fb2 parent cb2c113

8 files changed

docs/skill/cel-tui/SKILL.md+1−1
@@ -263,7 +263,7 @@ VStack({ flex: 1, overflow: "scroll", padding: { x: 1 } }, [
263263 SyntaxHighlight(source, "javascript", { theme: "dark-plus" });
264264 ```
265265
266-`SyntaxHighlight(content, language, props?)` renders registered `clew` languages into cel-tui primitives. Current ids include the TypeScript / JavaScript families plus `python` / `py`, `bash`, `json`, and `markdown`. The component stays synchronous to call, but append-only updates reuse a cached `clew` stream while non-append edits replay the full snippet, so final output stays stable across streamed chunk boundaries. Unknown language ids render plain text. The optional `theme` accepts the small …
266+`SyntaxHighlight(content, language, props?)` renders registered `clew` languages into cel-tui primitives. Current ids include the TypeScript / JavaScript families plus `python` / `py`, `bash`, `json`, `markdown`, and `diff` / `patch`. The component stays synchronous to call, but append-only updates reuse a cached `clew` stream while non-append edits replay the full snippet, so final output stays stable across streamed chunk boundaries. Unknown language ids render plain text. The optional `theme` …
267267
268268 ## Gotchas
269269
docs/skill/cel-tui/references/api.md+1−1
@@ -308,7 +308,7 @@ SyntaxHighlight(code, "javascript", { theme: "dark-plus" });
308308 ```
309309
310310 - Signature: `SyntaxHighlight(content, language, props?)`
311-- `language` accepts registered `clew` language ids (`typescript` / `javascript` families plus `python` / `py`, `bash`, `json`, and `markdown` right now)
311+- `language` accepts registered `clew` language ids (`typescript` / `javascript` families plus `python` / `py`, `bash`, `json`, `markdown`, and `diff` / `patch` right now)
312312 - `props.theme` accepts the built-in presets (`"default"`, `"dark-plus"`) or a best-effort token theme registration object targeting canonical `clew` scopes
313313 - Uses a terminal-friendly ANSI 16 fallback theme by default
314314 - Highlighting is synchronous at the component boundary; unsupported languages render plain text
examples/diff-highlight.ts+278−0
@@ -0,0 +1,278 @@
1+/**
2+ * cel-tui: Diff / patch highlighting
3+ *
4+ * Demonstrates clew's `diff` / `patch` language support through the
5+ * SyntaxHighlight component, including git-style patches and output shaped
6+ * like `createPatch` from the npm `diff` package.
7+ *
8+ * Run: bun run examples/diff-highlight.ts
9+ */
10+
11+import { cel, HStack, ProcessTerminal, Text, VStack } from "@cel-tui/core";
12+import {
13+ Divider,
14+ Spacer,
15+ SyntaxHighlight,
16+ type SyntaxHighlightTheme,
17+ VDivider,
18+} from "@cel-tui/components";
19+import { warningBox } from "./warning-box";
20+
21+const MIN_COLS = 58;
22+const MIN_ROWS = 16;
23+const SIDE_BY_SIDE_MIN_COLS = 104;
24+
25+interface PatchSample {
26+ title: string;
27+ language: "diff" | "patch";
28+ description: string;
29+ source: string;
30+}
31+
32+const DIFF_THEME: SyntaxHighlightTheme = {
33+ name: "diff-highlight-demo",
34+ type: "dark",
35+ fg: "#e5e5e5",
36+ bg: "#000000",
37+ tokenColors: [
38+ { settings: { foreground: "#e5e5e5" } },
39+ {
40+ scope: ["diff.header", "diff.hunk"],
41+ settings: { foreground: "#29b8db", fontStyle: "bold" },
42+ },
43+ {
44+ scope: "diff.file.old",
45+ settings: { foreground: "#f14c4c", fontStyle: "bold" },
46+ },
47+ {
48+ scope: "diff.file.new",
49+ settings: { foreground: "#23d18b", fontStyle: "bold" },
50+ },
51+ {
52+ scope: "diff.inserted",
53+ settings: { foreground: "#23d18b" },
54+ },
55+ {
56+ scope: "diff.deleted",
57+ settings: { foreground: "#f14c4c" },
58+ },
59+ {
60+ scope: "diff.context",
61+ settings: { foreground: "#e5e5e5" },
62+ },
63+ {
64+ scope: "diff.no-newline",
65+ settings: { foreground: "#666666", fontStyle: "italic" },
66+ },
67+ {
68+ scope: ["operator", "diff.marker"],
69+ settings: { foreground: "#bc3fbc" },
70+ },
71+ ],
72+};
73+
74+const THEME_OPTIONS: ReadonlyArray<{
75+ label: string;
76+ theme?: SyntaxHighlightTheme;
77+}> = [
78+ { label: "terminal ansi16" },
79+ { label: "diff tuned", theme: DIFF_THEME },
80+ { label: "dark-plus", theme: "dark-plus" },
81+];
82+
83+const SAMPLES: readonly PatchSample[] = [
84+ {
85+ title: "Git patch",
86+ language: "diff",
87+ description:
88+ "A unified git patch with file metadata, hunk headers, additions, removals, and context lines.",
89+ source: [
90+ "diff --git a/packages/clew/src/index.ts b/packages/clew/src/index.ts",
91+ "index a734b9a..0928140 100644",
92+ "--- a/packages/clew/src/index.ts",
93+ "+++ b/packages/clew/src/index.ts",
94+ "@@ -34,7 +34,7 @@ export function clew(content: string, options: ClewOptions) {",
95+ ' * Streaming is the default mode, and `stability` defaults to "eager".',
96+ " *",
97+ " * The current implementation supports TypeScript / JavaScript ids, Python,",
98+ "- * Bash, JSON, and Markdown.",
99+ "+ * Bash, JSON, Markdown, and diff/patch.",
100+ " */",
101+ " export function clew(content: string, options: ClewStreamOptions): ClewStream;",
102+ ].join("\n"),
103+ },
104+ {
105+ title: "createPatch output",
106+ language: "patch",
107+ description:
108+ "A patch shaped like createPatch(filename, oldText, newText) from the npm diff package.",
109+ source: [
110+ "Index: greeting.txt",
111+ "===================================================================",
112+ "--- greeting.txt",
113+ "+++ greeting.txt",
114+ "@@ -1,6 +1,7 @@",
115+ " hello from cel-tui",
116+ "-old tokenizer path",
117+ "+new diff tokenizer path",
118+ " context survives unchanged",
119+ "+patch aliases are supported too",
120+ " final line",
121+ "\\ No newline at end of file",
122+ ].join("\n"),
123+ },
124+];
125+
126+let sampleIndex = 0;
127+let themeIndex = 1;
128+
129+function currentSample(): PatchSample {
130+ return SAMPLES[sampleIndex] ?? SAMPLES[0]!;
131+}
132+
133+function currentTheme() {
134+ return THEME_OPTIONS[themeIndex] ?? THEME_OPTIONS[0]!;
135+}
136+
137+function selectSample(delta: number) {
138+ sampleIndex = (sampleIndex + delta + SAMPLES.length) % SAMPLES.length;
139+ cel.render();
140+}
141+
142+function toggleTheme() {
143+ themeIndex = (themeIndex + 1) % THEME_OPTIONS.length;
144+ cel.render();
145+}
146+
147+function quit() {
148+ cel.stop();
149+ process.exit(0);
150+}
151+
152+function sampleChip(sample: PatchSample, index: number) {
153+ const selected = index === sampleIndex;
154+
155+ return Text(` ${sample.language} `, {
156+ fgColor: selected ? "color15" : "color08",
157+ bgColor: selected ? "color06" : undefined,
158+ bold: selected || undefined,
159+ });
160+}
161+
162+function infoPane() {
163+ const sample = currentSample();
164+ const theme = currentTheme();
165+
166+ return VStack({ padding: { x: 1 }, gap: 1 }, [
167+ Text("Diff highlight demo", { bold: true, fgColor: "color06" }),
168+ Text("SyntaxHighlight(sample, language, { theme })", {
169+ fgColor: "color08",
170+ italic: true,
171+ }),
172+ Divider({ fgColor: "color08" }),
173+ Text(sample.title, { bold: true, fgColor: "color03" }),
174+ Text(sample.description, { fgColor: "color08", wrap: "word" }),
175+ Text(`language: ${sample.language}`, { fgColor: "color08" }),
176+ Text(`theme: ${theme.label}`, { fgColor: "color08" }),
177+ Divider({ fgColor: "color08" }),
178+ Text("Try it", { bold: true, fgColor: "color06" }),
179+ Text("Left/Right or Tab switch patch", { fgColor: "color08" }),
180+ Text("Ctrl+T cycle theme", { fgColor: "color08" }),
181+ Text("Ctrl+Q quit", { fgColor: "color08" }),
182+ ]);
183+}
184+
185+function patchPane() {
186+ const sample = currentSample();
187+ const theme = currentTheme();
188+
189+ return VStack({ flex: 1 }, [
190+ HStack({ padding: { x: 1 }, gap: 1 }, [
191+ Text(sample.title, { bold: true, fgColor: "color06" }),
192+ Spacer(),
193+ Text(`SyntaxHighlight(..., \"${sample.language}\")`, {
194+ fgColor: "color08",
195+ }),
196+ ]),
197+ Divider({ fgColor: "color08" }),
198+ VStack(
199+ {
200+ flex: 1,
201+ overflow: "scroll",
202+ scrollbar: true,
203+ padding: { x: 1 },
204+ },
205+ [SyntaxHighlight(sample.source, sample.language, { theme: theme.theme })],
206+ ),
207+ ]);
208+}
209+
210+function mainView(cols: number) {
211+ if (cols >= SIDE_BY_SIDE_MIN_COLS) {
212+ return HStack({ flex: 1 }, [
213+ VStack({ width: 36, overflow: "scroll", scrollbar: true }, [infoPane()]),
214+ VDivider({ fgColor: "color08" }),
215+ patchPane(),
216+ ]);
217+ }
218+
219+ return VStack({ flex: 1 }, [
220+ infoPane(),
221+ Divider({ fgColor: "color08" }),
222+ patchPane(),
223+ ]);
224+}
225+
226+cel.init(new ProcessTerminal());
227+cel.viewport(() => {
228+ const cols = process.stdout.columns || 80;
229+ const rows = process.stdout.rows || 24;
230+
231+ if (cols < MIN_COLS || rows < MIN_ROWS) {
232+ return VStack(
233+ {
234+ height: "100%",
235+ justifyContent: "center",
236+ alignItems: "center",
237+ onKeyPress: (key) => {
238+ if (key === "ctrl+q" || key === "ctrl+c") quit();
239+ },
240+ },
241+ [
242+ ...warningBox([
243+ " Terminal too small :(",
244+ "",
245+ " Please resize to at",
246+ ` least ${String(MIN_COLS).padStart(3)}×${String(MIN_ROWS).padStart(2)} chars.`,
247+ "",
248+ " Ctrl+Q to quit",
249+ ]),
250+ ],
251+ );
252+ }
253+
254+ return VStack(
255+ {
256+ height: "100%",
257+ onKeyPress: (key) => {
258+ if (key === "ctrl+q" || key === "ctrl+c") quit();
259+ if (key === "ctrl+t") toggleTheme();
260+ if (key === "left" || key === "shift+tab") selectSample(-1);
261+ if (key === "right" || key === "tab") selectSample(1);
262+ },
263+ },
264+ [
265+ HStack({ padding: { x: 1 }, gap: 2 }, [
266+ Text("Diff / patch highlighting", { bold: true, fgColor: "color06" }),
267+ Spacer(),
268+ Text(`theme: ${currentTheme().label}`, { fgColor: "color03" }),
269+ ]),
270+ Divider({ fgColor: "color08" }),
271+ HStack({ padding: { x: 1 }, gap: 1, flexWrap: "wrap" }, [
272+ ...SAMPLES.map(sampleChip),
273+ ]),
274+ Divider({ fgColor: "color08" }),
275+ mainView(cols),
276+ ],
277+ );
278+});
packages/clew/README.md+2−0
@@ -132,6 +132,8 @@ The current implementation ships a small internal language registry with:
132132 - `json`
133133 - **Markdown**
134134 - `markdown`
135+- **Diff / patch**
136+ - `diff`, `patch`
135137
136138 `clew` emits normalized tokens with canonical scopes like `keyword`, `string`,
137139 `property`, `link`, `markup.heading`, `meta.substitution.command`, and
packages/clew/src/index.test.ts+166−0
@@ -72,6 +72,8 @@ describe("clew", () => {
7272 expect(clewSupportsLanguage("bash")).toBe(true);
7373 expect(clewSupportsLanguage("json")).toBe(true);
7474 expect(clewSupportsLanguage("markdown")).toBe(true);
75+ expect(clewSupportsLanguage("diff")).toBe(true);
76+ expect(clewSupportsLanguage("patch")).toBe(true);
7577 expect(clewSupportsLanguage("tsx")).toBe(false);
7678 expect(clewSupportsLanguage("jsx")).toBe(false);
7779 expect(clewSupportsLanguage("shell")).toBe(false);
@@ -95,6 +97,14 @@ describe("clew", () => {
9597 "# Title\n- item with `code`\n> quote [link](https://example.com)\n",
9698 "markdown",
9799 );
100+ expectFullCoverage(
101+ "diff --git a/a.txt b/a.txt\n--- a/a.txt\n+++ b/a.txt\n@@ -1 +1 @@\n-old\n+new\n",
102+ "diff",
103+ );
104+ expectFullCoverage(
105+ "Index: a.txt\n===================================================================\n--- a.txt\n+++ a.txt\n@@ -1,1 +1,1 @@\n-old\n+new\n",
106+ "patch",
107+ );
98108 });
99109
100110 test("tokenizes richer TypeScript declaration, property, function, and literal scopes", () => {
@@ -271,6 +281,162 @@ describe("clew", () => {
271281 ]);
272282 });
273283
284+ test("tokenizes unified and git diff line classes", () => {
285+ const source = [
286+ "diff --git a/src/file.ts b/src/file.ts",
287+ "index 83db48f..f735c2d 100644",
288+ "old mode 100644",
289+ "new mode 100755",
290+ "deleted file mode 100644",
291+ "new file mode 100644",
292+ "similarity index 96%",
293+ "dissimilarity index 12%",
294+ "rename from src/old.ts",
295+ "rename to src/new.ts",
296+ "copy from src/source.ts",
297+ "copy to src/copy.ts",
298+ "--- /dev/null",
299+ "+++ b/src/file.ts",
300+ "@@ -0,0 +1,3 @@ optional section",
301+ "+added line",
302+ "-removed line",
303+ " context line",
304+ "\\ No newline at end of file",
305+ "plain fallback",
306+ "",
307+ ].join("\n");
308+
309+ expectTokenScopes(
310+ "diff",
311+ source,
312+ "diff --git a/src/file.ts b/src/file.ts",
313+ ["meta", "diff.header"],
314+ );
315+ expectTokenScopes("diff", source, "index 83db48f..f735c2d 100644", [
316+ "meta",
317+ "diff.header",
318+ ]);
319+ expectTokenScopes("diff", source, "old mode 100644", [
320+ "meta",
321+ "diff.header",
322+ ]);
323+ expectTokenScopes("diff", source, "new mode 100755", [
324+ "meta",
325+ "diff.header",
326+ ]);
327+ expectTokenScopes("diff", source, "deleted file mode 100644", [
328+ "meta",
329+ "diff.header",
330+ ]);
331+ expectTokenScopes("diff", source, "new file mode 100644", [
332+ "meta",
333+ "diff.header",
334+ ]);
335+ expectTokenScopes("diff", source, "similarity index 96%", [
336+ "meta",
337+ "diff.header",
338+ ]);
339+ expectTokenScopes("diff", source, "dissimilarity index 12%", [
340+ "meta",
341+ "diff.header",
342+ ]);
343+ expectTokenScopes("diff", source, "rename from src/old.ts", [
344+ "meta",
345+ "diff.header",
346+ ]);
347+ expectTokenScopes("diff", source, "rename to src/new.ts", [
348+ "meta",
349+ "diff.header",
350+ ]);
351+ expectTokenScopes("diff", source, "copy from src/source.ts", [
352+ "meta",
353+ "diff.header",
354+ ]);
355+ expectTokenScopes("diff", source, "copy to src/copy.ts", [
356+ "meta",
357+ "diff.header",
358+ ]);
359+ expectTokenScopes("diff", source, "--- /dev/null", [
360+ "meta",
361+ "diff.file.old",
362+ ]);
363+ expectTokenScopes("diff", source, "+++ b/src/file.ts", [
364+ "meta",
365+ "diff.file.new",
366+ ]);
367+ expectTokenScopes("diff", source, "@@ -0,0 +1,3 @@ optional section", [
368+ "meta",
369+ "diff.hunk",
370+ ]);
371+ expectTokenScopes("diff", source, "added line", [
372+ "string",
373+ "diff.inserted",
374+ ]);
375+ expectTokenScopes("diff", source, "removed line", [
376+ "comment",
377+ "diff.deleted",
378+ ]);
379+ expectTokenScopes("diff", source, "context line", ["text", "diff.context"]);
380+ expectTokenScopes("diff", source, "\\ No newline at end of file", [
381+ "comment",
382+ "diff.no-newline",
383+ ]);
384+ expectTokenType("diff", source, "plain fallback", "text");
385+ });
386+
387+ test("tokenizes npm diff createPatch-style headers", () => {
388+ const source = [
389+ "Index: file.txt",
390+ "===================================================================",
391+ "--- file.txt",
392+ "+++ file.txt",
393+ "@@ -1,2 +1,2 @@",
394+ " line",
395+ "-before",
396+ "+after",
397+ "",
398+ ].join("\n");
399+
400+ expectTokenScopes("patch", source, "Index: file.txt", [
401+ "meta",
402+ "diff.header",
403+ ]);
404+ expectTokenScopes(
405+ "patch",
406+ source,
407+ "===================================================================",
408+ ["meta", "diff.header"],
409+ );
410+ expectTokenScopes("patch", source, "--- file.txt", [
411+ "meta",
412+ "diff.file.old",
413+ ]);
414+ expectTokenScopes("patch", source, "+++ file.txt", [
415+ "meta",
416+ "diff.file.new",
417+ ]);
418+ expectTokenScopes("patch", source, "before", ["comment", "diff.deleted"]);
419+ expectTokenScopes("patch", source, "after", ["string", "diff.inserted"]);
420+ });
421+
422+ test("streams diff final output consistently across chunk boundaries", () => {
423+ const content =
424+ "diff --git a/a.txt b/a.txt\n--- a/a.txt\n+++ b/a.txt\n@@ -1 +1 @@\n-old\n+new\n";
425+ const direct = clew(content, { lang: "diff", stream: false });
426+ const stream = clew("", { lang: "diff" });
427+
428+ for (const chunk of [
429+ "diff --git a/a",
430+ ".txt b/a.txt\n--- a/a.txt\n+",
431+ "++ b/a.txt\n@@ -1 +1 @@\n-o",
432+ "ld\n+new\n",
433+ ]) {
434+ stream.write(chunk);
435+ }
436+
437+ expect(stream.end()).toEqual(direct);
438+ });
439+
274440 test("streams append-only chunks eagerly by default", () => {
275441 const stream = clew("", { lang: "ts" });
276442 const chunks: Array<{ from: number; to: number; text: string }> = [];
packages/clew/src/index.ts+1−1
@@ -34,7 +34,7 @@ export function clew(content: string, options: ClewSyncOptions): ClewOutput;
3434 * Streaming is the default mode, and `stability` defaults to `"eager"`.
3535 *
3636 * The current implementation supports TypeScript / JavaScript ids, Python,
37- * Bash, JSON, and Markdown.
37+ * Bash, JSON, Markdown, and diff/patch.
3838 */
3939 export function clew(content: string, options: ClewStreamOptions): ClewStream;
4040 export function clew(
packages/clew/src/languages/diff.ts+126−0
@@ -0,0 +1,126 @@
1+import type { ClewOutput, ClewToken } from "../model.js";
2+import type { ClewLanguageSupport } from "../registry.js";
3+import { pushTokenRange, splitLines, stableLineBoundary } from "../shared.js";
4+
5+const GIT_FILE_HEADER_PREFIXES = [
6+ "diff --git ",
7+ "index ",
8+ "old mode ",
9+ "new mode ",
10+ "deleted file mode ",
11+ "new file mode ",
12+ "similarity index ",
13+ "dissimilarity index ",
14+ "rename from ",
15+ "rename to ",
16+ "copy from ",
17+ "copy to ",
18+] as const;
19+
20+function pushToken(
21+ tokens: ClewToken[],
22+ content: string,
23+ start: number,
24+ end: number,
25+ type: string,
26+ scopes?: readonly string[],
27+): void {
28+ pushTokenRange(tokens, content, start, end, type, scopes);
29+}
30+
31+function isGitFileHeader(text: string): boolean {
32+ return GIT_FILE_HEADER_PREFIXES.some((prefix) => text.startsWith(prefix));
33+}
34+
35+function isDiffPackageIndexHeader(text: string): boolean {
36+ return text.startsWith("Index: ") || /^={3,}$/.test(text);
37+}
38+
39+function tokenizePrefixedLine(
40+ tokens: ClewToken[],
41+ content: string,
42+ lineStart: number,
43+ lineEnd: number,
44+ bodyType: string,
45+ bodyScopes: readonly string[],
46+): void {
47+ pushToken(tokens, content, lineStart, lineStart + 1, "operator", [
48+ "operator",
49+ "diff.marker",
50+ ]);
51+ pushToken(tokens, content, lineStart + 1, lineEnd, bodyType, bodyScopes);
52+}
53+
54+function tokenizeDiff(content: string): ClewOutput {
55+ const tokens: ClewToken[] = [];
56+
57+ for (const line of splitLines(content)) {
58+ const lineStart = line.start;
59+ const lineEnd = line.start + line.text.length;
60+ const text = line.text;
61+
62+ if (text.length === 0) {
63+ // Empty lines are represented by their delimiter below.
64+ } else if (isGitFileHeader(text) || isDiffPackageIndexHeader(text)) {
65+ pushToken(tokens, content, lineStart, lineEnd, "meta", [
66+ "meta",
67+ "diff.header",
68+ ]);
69+ } else if (text.startsWith("--- ")) {
70+ pushToken(tokens, content, lineStart, lineEnd, "meta", [
71+ "meta",
72+ "diff.file.old",
73+ ]);
74+ } else if (text.startsWith("+++ ")) {
75+ pushToken(tokens, content, lineStart, lineEnd, "meta", [
76+ "meta",
77+ "diff.file.new",
78+ ]);
79+ } else if (/^@@\s+-\d+(?:,\d+)?\s+\+\d+(?:,\d+)?\s+@@/.test(text)) {
80+ pushToken(tokens, content, lineStart, lineEnd, "meta", [
81+ "meta",
82+ "diff.hunk",
83+ ]);
84+ } else if (text.startsWith("+")) {
85+ tokenizePrefixedLine(tokens, content, lineStart, lineEnd, "string", [
86+ "string",
87+ "diff.inserted",
88+ ]);
89+ } else if (text.startsWith("-")) {
90+ tokenizePrefixedLine(tokens, content, lineStart, lineEnd, "comment", [
91+ "comment",
92+ "diff.deleted",
93+ ]);
94+ } else if (text.startsWith(" ")) {
95+ tokenizePrefixedLine(tokens, content, lineStart, lineEnd, "text", [
96+ "text",
97+ "diff.context",
98+ ]);
99+ } else if (text === "\\ No newline at end of file") {
100+ pushToken(tokens, content, lineStart, lineEnd, "comment", [
101+ "comment",
102+ "diff.no-newline",
103+ ]);
104+ } else {
105+ pushToken(tokens, content, lineStart, lineEnd, "text");
106+ }
107+
108+ if (line.delimiter.length > 0) {
109+ pushToken(
110+ tokens,
111+ content,
112+ lineEnd,
113+ lineEnd + line.delimiter.length,
114+ "whitespace",
115+ );
116+ }
117+ }
118+
119+ return { tokens };
120+}
121+
122+export const diffLanguageSupport: ClewLanguageSupport = {
123+ ids: ["diff", "patch"],
124+ stableBoundary: stableLineBoundary,
125+ tokenize: tokenizeDiff,
126+};
packages/clew/src/registry.ts+2−0
@@ -1,4 +1,5 @@
11 import { bashLanguageSupport } from "./languages/bash.js";
2+import { diffLanguageSupport } from "./languages/diff.js";
23 import { jsonLanguageSupport } from "./languages/json.js";
34 import { markdownLanguageSupport } from "./languages/markdown.js";
45 import { pythonLanguageSupport } from "./languages/python.js";
@@ -17,6 +18,7 @@ const languageSupports = [
1718 bashLanguageSupport,
1819 jsonLanguageSupport,
1920 markdownLanguageSupport,
21+ diffLanguageSupport,
2022 ] satisfies readonly ClewLanguageSupport[];
2123
2224 const supportById = new Map<string, ClewLanguageSupport>();