mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-11 06:20:24 +01:00
Two issues fixed:
1. Initialize stateExtensions with empty object {} instead of undefined.
When called with no argument, the schema state was undefined, causing
jsonCompletion() to return [] instead of a proper result object, which
CodeMirror's autocomplete didn't handle correctly.
2. Change editorView from useRef to useState so the effect that calls
updateSchema() properly re-runs when the editor view is set. With useRef,
the effect could run before the editor was mounted or with a stale
reference when the editor was recreated.