Skip to content

fix(editor): restore correct SQL string color across all themes#192

Merged
debba merged 1 commit into
TabularisDB:mainfrom
thomaswasle:bug/SQL-string-color
May 13, 2026
Merged

fix(editor): restore correct SQL string color across all themes#192
debba merged 1 commit into
TabularisDB:mainfrom
thomaswasle:bug/SQL-string-color

Conversation

@thomaswasle
Copy link
Copy Markdown
Contributor

@thomaswasle thomaswasle commented May 12, 2026

Problem

SQL string literals (single-quoted values like 'foo') were rendering in a barely-readable dark
red in the Monaco editor for all themes (most visible in Dracula).

Root cause: Monaco's built-in SQL tokenizer sets tokenPostfix: ".sql", which means the token type
for SQL strings is string.sql, not string. Monaco 0.55 does not reliably fall back from
string.sql to the generic string rule, so SQL strings received no color override and fell through
to the base theme's unmatched-token rendering — a dark red on dark backgrounds.

Fix

Added an explicit string.sql token rule to every bundled Monaco theme JSON, using the same color
already defined for the generic string rule. Also updated generateMonacoTheme() in themeUtils.ts
to inject string.sql / string.quote.sql rules for themes that don't have a JSON file (Tabularis
Dark, Tabularis Light, High Contrast).

Theme String color
Dracula #f1fa8c
Monokai #e6db74
Nord #a3be8c
GitHub Dark #79b8ff
GitHub Light #032f62
Night Owl #addb67
One Dark Pro #98c379
Solarized Dark/Light #2aa198
Tomorrow Night Eighties #99cc99

Testing

Open the SQL console, select any theme, and type a query with a single-quoted string literal — it
should render in the theme's string color instead of red.

@debba debba merged commit bb1d3bc into TabularisDB:main May 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants