Skip to content

feat(sql-editor): Jupyter-style notebook cells in Monaco - #124

Merged
huyplb merged 5 commits into
mainfrom
cursor/jupyter-style-cells-7e48
Jul 29, 2026
Merged

feat(sql-editor): Jupyter-style notebook cells in Monaco#124
huyplb merged 5 commits into
mainfrom
cursor/jupyter-style-cells-7e48

Conversation

@huyplb

@huyplb huyplb commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Jupyter-inspired notebook cells for the SQL Editor, Prettier for mixed SQL+JS, and a fix so JS/TS code cells get real syntax colors again.

Notebook cells

  • Monaco cell banding + left edge (sky = SQL, teal = code)
  • Strip: In [n]:, kind badge, per-cell Play via execute({ statementIndices })
  • Results: Out [n]: …

Format / Prettier

  • Peel -- @set inside fences before Prettier (samples were silently unformatted)
  • Toolbar Format SQL+JS with status note

JS highlighting fix

  • Root cause: ensureFoxschemaSqlLanguage wrote __foxschemaSqlLanguageRegistered onto the Monaco ESM export object → TypeError: Cannot assign… → registration aborted → editor stayed on plain SQL (black/const uncolored)
  • Fix: module-local ready flag; foxschema-sql + embedded text/javascript / text/typescript apply again

JS keywords cyan after fix

Try it

  1. Hard-refresh the preview
  2. Open ★ Sample · JS Promise.all fetch (or any -- @js cell)
  3. const / await / return should be cyan; strings green

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 4 commits July 28, 2026 20:26
Add cell banding and left-edge accents in the single Monaco buffer,
In [n] strip chrome with per-cell Play (execute statementIndices),
Out [n] result labels, and preserve indices across password/Safe-mode
resume. Reuses the existing splitter and run pipeline.

Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>
Peel leading @set directives before Prettier so mixed SQL+JS samples
format; show Format SQL+JS status when sql-formatter/Prettier run.

Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>
Stop writing the registration flag onto the Monaco ESM namespace
(non-extensible); use a module-local ready bit so foxschema-sql
loads and embedded JavaScript highlighting actually applies.

Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>
Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>
…ns (#125)

* feat(sql-editor): FoxScript AST, markers, virtual docs, semantic tokens

Add parseFoxScript / compileFoxScriptPlan over the existing splitter,
register Monaco foxscript language, structural markers, JS/TS virtual
docs for last/vars/sql IntelliSense, and schema-cache semantic tokens.

Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>

* refactor(sql-editor): one FoxScript parse, cached facade, in-place virtual docs

Avoid re-parsing and disposing cell models on every decorate tick: LRU-cache
parseFoxScript on the web facade, drive glyphs/markers/virtual docs from one
document, and update virtual models with setValue when cells are stable.

Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>

* feat(sql-editor): add FoxScript notebook and Node sql samples

Thirteen new bookmarks: interleaved notebook tour, @set column, multi-SQL,
reduce/pivot, domains, try/catch, TS interfaces, sql.list/raw, Node-TS sql,
merge reshape, JSON round-trip, and strip ▶ one-cell demo.

Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>

* fix(sql-editor): move schema Edit table / View source to row right

Put object actions on the trailing edge of each schema row instead of
under the name, for tables/MQTs and scriptable objects alike.

Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>

* fix(sql-editor): keep full Edit table / View source labels on row

Restore the longer action labels with nowrap so they stay readable on
the trailing edge of schema rows.

Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>
@huyplb
huyplb marked this pull request as ready for review July 29, 2026 00:22
@huyplb
huyplb merged commit 9e99395 into main Jul 29, 2026
6 checks passed
@huyplb
huyplb deleted the cursor/jupyter-style-cells-7e48 branch July 29, 2026 00:22
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_ed4f9875-bc48-40fb-8650-488adba5e9a7)

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