Commit ae25d5c
feat: add custom language support with preset and grammar-based highlighting
Add a Languages tab to Settings for enabling syntax highlighting for
uncommon languages that Shiki doesn't support by default.
- Add CustomLanguageConfig type to editor types with support for two
modes: alias (map extensions to an existing Shiki language) and
custom grammar (paste a TextMate JSON for full proper highlighting)
- Add customLanguages[] to EditorSettingsManager (localStorage)
- Add CustomLanguageManager singleton service that reactively syncs
settings changes into the Shiki detectLanguage registry, loads
custom TextMate grammars into the Shiki highlighter on demand
- Simplify FileViewer ensureLanguageLoaded — remove hardcoded whitelist
and instead try any language ID, falling back to text on error;
this also enables all Shiki-bundled languages (terraform, nix, etc.)
- Add Languages settings tab with:
- Preset grid: Terraform/HCL, Protocol Buffers, GraphQL, Nix,
Solidity, Elixir, Dart, LookML — one-click enable for alias presets
- Custom language list with edit/delete actions
- Add/Edit form with mode toggle (alias vs TextMate grammar),
scopeName input, and JSON textarea with guidance links
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent f63c91d commit ae25d5c
9 files changed
Lines changed: 676 additions & 20 deletions
File tree
- frontend/src
- components
- editor
- settings
- services
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 34 | + | |
| 35 | + | |
37 | 36 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 37 | + | |
| 38 | + | |
48 | 39 | | |
49 | 40 | | |
50 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
3 | 28 | | |
4 | 29 | | |
5 | 30 | | |
| |||
44 | 69 | | |
45 | 70 | | |
46 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
47 | 79 | | |
48 | 80 | | |
49 | 81 | | |
| |||
188 | 220 | | |
189 | 221 | | |
190 | 222 | | |
191 | | - | |
| 223 | + | |
192 | 224 | | |
0 commit comments