add rebuildEditorState function to the syscalls (#1254)

pull/1246/head^2
numan 2025-02-22 10:51:37 +00:00 committed by GitHub
parent 9e0925beff
commit 2a3c926849
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -118,6 +118,13 @@ export function reloadUI(): Promise<void> {
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
*/

View File

@ -64,6 +64,9 @@ export function editorSyscalls(client: Client): SysCallMapping {
"editor.reloadUI": () => {
location.reload();
},
"editor.rebuildEditorState": () => {
client.rebuildEditorState();
},
"editor.reloadConfigAndCommands": async () => {
await client.loadConfig();