Skip to content

feat: add languages, line numbers and an mssql dialect to CodeEditor - #417

Open
andrewhuhh wants to merge 2 commits into
mainfrom
feat/code-editor-languages
Open

andrewhuhh wants to merge 2 commits into
mainfrom
feat/code-editor-languages

Conversation

@andrewhuhh

@andrewhuhh andrewhuhh commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Adds three things to CodeEditor.

A language prop ("sql" | "markdown" | "yaml" | "json" | "shell" | "python" | "javascript" | "typescript") defaults to "sql", so existing editors behave exactly as before and dialect still 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 lineNumbers prop 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.

CodeEditorDialect gains "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.

screenshot 1

screenshot 2

screenshot 3

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@aws-amplify-gen-3

aws-amplify-gen-3 Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Name Status Preview Updated
cipher/preview (a494829) ❌ Failed — 2026-12-04 00:19 UTC

Reason: OUTPUT_DIRECTORY_NOT_FOUND

@capy-ai capy-ai Bot added the visual-change label Dec 4, 2026

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@greptile-apps

greptile-apps Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; the dependency change addresses the previous consumer-build failure.

Summary

Adds eight language choices, optional line numbers, and SQL Server support to CodeEditor.

  • CodeEditor can highlight several languages beyond SQL.
  • CodeEditor can show a line-number gutter beside the text.
  • SQL callers can choose the SQL Server dialect.

Reviews (2) · Last reviewed commit: "fix: ship CodeEditor language packages a..." · Reviewed by Greptile

Comment thread src/ui/code-editor.tsx Resolved
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant