From 2a3c926849b57bb77ac64322325931e7581fffbc Mon Sep 17 00:00:00 2001 From: numan <97672144+numanhg@users.noreply.github.com> Date: Sat, 22 Feb 2025 10:51:37 +0000 Subject: [PATCH] add rebuildEditorState function to the syscalls (#1254) --- plug-api/syscalls/editor.ts | 7 +++++++ web/syscalls/editor.ts | 3 +++ 2 files changed, 10 insertions(+) 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();