diff --git a/plug-api/syscalls/editor.ts b/plug-api/syscalls/editor.ts index 57245611..0f35531a 100644 --- a/plug-api/syscalls/editor.ts +++ b/plug-api/syscalls/editor.ts @@ -118,6 +118,13 @@ export function reloadUI(): Promise { return syscall("editor.reloadUI"); } +/** + * Rebuilds the editor state to ensure the dispatch updates the state. + */ +export function rebuildEditorState() { + return syscall("editor.rebuildEditorState"); +} + /** * Reloads the config and commands, also in the server */ diff --git a/web/syscalls/editor.ts b/web/syscalls/editor.ts index fa852af5..32fe4875 100644 --- a/web/syscalls/editor.ts +++ b/web/syscalls/editor.ts @@ -64,6 +64,9 @@ export function editorSyscalls(client: Client): SysCallMapping { "editor.reloadUI": () => { location.reload(); }, + "editor.rebuildEditorState": () => { + client.rebuildEditorState(); + }, "editor.reloadConfigAndCommands": async () => { await client.loadConfig();