Skip to content

Commit eab2bbf

Browse files
authored
refactor: improve Monaco language definitions (#1832)
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
1 parent 0724254 commit eab2bbf

14 files changed

Lines changed: 1938 additions & 189 deletions

CLAUDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,9 @@ src/
165165
## Testing Conventions
166166

167167
- Unit tests in `src/util/__tests__/*.spec.ts` with Vitest + jsdom
168+
- Monarch tokenizer tests co-located in `src/monaco/language/__tests__/` — use shared `tokenize-helper.ts` (`registerLanguage`, `tokenizeLines`, `tokenBuilder`)
168169
- Global test functions (`describe`, `it`, `expect`) — `globals: true` in vitest config
169-
- Setup file: `tests/unit/setup.ts`
170+
- Setup file: `tests/unit/setup.ts` — includes `CSS.escape` and `window.matchMedia` polyfills required by Monaco in jsdom
170171
- Time manipulation utility: `timeTravel(date, callback)` in `tests/unit/utils.ts`
171172
- Parameterized tests: `it.each([...])` pattern
172173
- Test store actions/mutations independently from UI

docs/docs/features/file-editor.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Syntax highlighting is provided for the following file types:
2121

2222
| File Type | Highlighted Elements |
2323
|-----------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
24-
| **Klipper config** (`.cfg`) | Section headers, key names, values, boolean constants, comments, and SAVE_CONFIG block markers |
25-
| **Moonraker config** (`.conf`) | Section headers, key names, values, boolean constants, space-prefixed escaped comment sigils (`\#`, `\;`), inline comments, and comments |
26-
| **G-code** (`.gcode`, `.g`, `.gc`, `.gco`, `.ufp`, `.nc`) | G/M/T commands, coordinates, feed rates, tool and offset registers, math functions, macro variables, and control keywords |
24+
| **Klipper config** (`.cfg`) | Section headers, key names, values, comments, and SAVE_CONFIG block markers |
25+
| **Moonraker config** (`.conf`) | Section headers, key names, values, and comments |
26+
| **G-code** (`.gcode`, `.g`, `.gc`, `.gco`, `.ufp`, `.nc`) | G/M/T/N command codes, checksum tags, M117/M118 messages, macro names and parameters, parameter letters (X, Y, Z, E, F, S), and comments |
2727
| **Log files** (`.log`) | Log-level colorization (debug, info, warning, error, critical), timestamps, URLs, UUIDs, git SHAs, exception names, and stack traces |
2828
| **JSON** | Full validation and IntelliSense via a dedicated language worker |
2929
| **CSS, SCSS, Less** | Property completion, hover, and validation via a dedicated language worker |

public/editor.theme.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)