feat(editor): add SQL language support#264
Closed
amaralkaff wants to merge 6 commits into
Closed
Conversation
Owner
|
Thanks for the PR. Ended up going with @codemirror/legacy-modes/mode/sql instead in ee1c9bb (already bundled for Ruby/C/etc, ~20KB smaller, covers more dialects: standardSQL, mySQL, pgSQL, sqlite, mariaDB, msSQL, plSQL). No autocomplete from the parser-based lang-sql, but we don't have LSP anyway so visual highlighting is identical. Appreciate the push to add SQL support. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds CodeMirror SQL language support so
.sqlfiles (and common dialect extensions) get syntax highlighting in the editor.Why
SQL files currently render as plain text. Mirrors the pattern from #127 (Go support).
How
package.json: add@codemirror/lang-sql(~30 KB gzipped, ships all dialects)src/modules/editor/lib/languageResolver.ts: add loaders forsql(StandardSQL),psql/pgsql(PostgreSQL),mysql(MySQL),sqlite(SQLite). One package, dialect picked per extension.Testing
pnpm exec tsc --noEmitcleansrc-tauri/)cargo checkclean — N/A, nosrc-tauri/changes;pnpm tauri devbuilds cleanpnpm tauri dev— opened.sql,.psql,.mysql,.sqlitefiles; keywords/strings/comments highlight per dialectScreenshots / GIFs
N/A — pure language pack registration, no visual UI change beyond editor token colors.
Notes for reviewer
Same shape as #127. Bundle impact is one dynamic-imported chunk that only loads when a matching file is opened.