Repository navigation
feat: add languages, line numbers and an mssql dialect to CodeEditor - #417
Open
andrewhuhh wants to merge 2 commits into
Open
andrewhuhh wants to merge 2 commits into
andrewhuhh wants to merge 2 commits into
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; the dependency change addresses the previous consumer-build failure.
|
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This branch has not been deployed
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.
Adds three things to
CodeEditor.A
languageprop ("sql" | "markdown" | "yaml" | "json" | "shell" | "python" | "javascript" | "typescript") defaults to"sql", so existing editors behave exactly as before anddialectstill picks the SQL engine. Every other language loads its CodeMirror package on first use through a dynamic import, so the SQL path loads nothing new. The official@codemirror/lang-*packages cover Markdown, YAML, JSON, Python, JavaScript and TypeScript, and shell uses the stream mode from@codemirror/legacy-modes. They ship as regular dependencies, so apps that only use SQL keep building without installing anything new, and each one stays in its own chunk until that language is first used.An opt-in
lineNumbersprop shows a line number gutter. It uses the muted text color and the editor's mono font with no background or border, so it reads the same in Light and Dark. Long lines wrap and their number stays on the first row.CodeEditorDialectgains"mssql", using CodeMirror's SQL Server dialect.The code editor page gains two examples. One shows YAML and JSON with line numbers, including very long values and an empty editor. The other is a SQL Server query. Both hold at 390px without horizontal overflow, and new visual baselines are included for them. No existing baseline changed.