Skip to content

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

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

feat(sql-editor): FoxScript AST, markers, virtual docs, semantic tokens#125
huyplb merged 5 commits into
cursor/jupyter-style-cells-7e48from
cursor/foxscript-7e48

Conversation

@huyplb

@huyplb huyplb commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Introduces a FoxScript language spine on top of the existing SQL splitter / notebook cells (stacks on #124).

  • AST (parseFoxScript / compileFoxScriptPlan) — composes splitSqlStatements + checkStatement (no second scanner)
  • Monaco foxscript language (keeps legacy foxschema-sql) with shared Monarch fence highlighting
  • Structural markers for missing @end / return / incomplete SQL
  • Virtual docs for code cells with last / vars / sql hover + completions
  • Semantic tokens for table/column names from schemaCache in SQL blocks
  • Thin execution plan API only — runtime still uses existing execute paths

Out of scope

  • Replacing the execute runner with a plan interpreter
  • Full TS language-service worker diagnostics
  • @python cells / “never execute raw source”

Test plan

  • vitest — 614 passed (includes new foxscript-ast tests)
  • tsc --noEmit for apps/web
  • Manual: open SQL Editor → language upgrades to FoxScript; missing -- @end shows marker; hover last inside -- @js; schema-loaded table names tint in SQL blocks
Open in Web Open in Cursor 

cursoragent and others added 5 commits July 28, 2026 23:48
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>
…rtual 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>
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>
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>
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>
@huyplb
huyplb marked this pull request as ready for review July 29, 2026 00:20
@huyplb
huyplb merged commit 5482cda into cursor/jupyter-style-cells-7e48 Jul 29, 2026
4 checks passed
@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_d29fbb84-6447-448c-906b-e99d9b848f12)

@huyplb
huyplb deleted the cursor/foxscript-7e48 branch July 29, 2026 00:20
huyplb added a commit that referenced this pull request Jul 29, 2026
* feat(sql-editor): Jupyter-style notebook cells in Monaco

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>

* fix(sql-editor): Prettier JS cells that contain -- @set

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>

* fix(sql-editor): restore JS/TS colors inside -- @js cells

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>

* docs(agents): note Monaco ESM flag broke JS cell highlighting

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

* feat(sql-editor): FoxScript AST, markers, virtual docs, semantic tokens (#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>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>
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