Skip to content

Create CodeMirror extension to register AST as StateField #9237

Merged
franknoirot merged 18 commits intomainfrom
franknoirot/8880/ast-extension
Dec 10, 2025
Merged

Create CodeMirror extension to register AST as StateField #9237
franknoirot merged 18 commits intomainfrom
franknoirot/8880/ast-extension

Conversation

@franknoirot
Copy link
Copy Markdown
Contributor

@franknoirot franknoirot commented Dec 8, 2025

Towards #8885, stacked on #9236. Adding a for-now unused CodeMirror extension that registers the AST as a StateField on the EditorView. Right now we trash the EditorView constantly so that value will not be trustworthy, but it will be once we remove all our React scaffolding around CodeMirror, which is a work-in-progress in #9190. Then this will be available to become the canonical derived AST state, automatically updated whenever the code is updated by the user.

Baby step towards #8885 broken out from a larger effort in #9190. Just
meant to start categorizing and commenting on the many class properties
in this class, as we step towards consolidating them.
@vercel
Copy link
Copy Markdown

vercel bot commented Dec 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
modeling-app Ready Ready Preview Comment Dec 10, 2025 6:34pm

github-actions bot and others added 8 commits December 8, 2025 15:42
@franknoirot franknoirot force-pushed the franknoirot/8880/ast-extension branch from 910d88a to a652ccb Compare December 8, 2025 17:26
Towards #8885, stacked on #9236. Adding a for-now unused CodeMirror
extension that registers the AST as a StateField on the EditorView.
Right now we trash the EditorView constantly so that value will not be
trustworthy, but it will be once we remove all our React scaffolding
around CodeMirror, which is a work-in-progress in #9190. Then this will
be available to become the canonical derived AST state, automatically
updated whenever the code is updated by the user.
@pierremtb
Copy link
Copy Markdown
Contributor

Not going to pretend that I know codemirror well but this seems sound and not impacting the current stuff (except maybe calling that ast setter, but should rely on the tests for that)

@franknoirot franknoirot merged commit 1f84887 into main Dec 10, 2025
53 of 56 checks passed
@franknoirot franknoirot deleted the franknoirot/8880/ast-extension branch December 10, 2025 18:28
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.

2 participants