Skip to content

five-on-it / apps/client/src/ui/studio/CodeEditor

apps/client/src/ui/studio/CodeEditor ​

The studio's code editor: a JSON document (a level spec, a game) in CodeMirror 6, its syntax highlighted in the overlay's colours, its brackets matched, its objects and lists folded, its parse error and the issues found in it (a solver's, a schema's, each at its path, json-paths.ts) marked on their lines and in the gutter. Format pretty-prints it (Shift+Alt+F), Apply (Ctrl+S here) formats it and hands it on, parsed, as one edit; Revert goes back to the document as given. Its own undo (Ctrl+Z) is the text's. The element keeps the text as typed in data-doc and how many marks it has in data-marks, the end-to-end tests' handles.

Interfaces ​

Functions ​