Skip to main content

DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/IPC/WindServiceHandlers/NativeHost/
Relaunch.rs

1#![allow(non_snake_case)]
2
3//! `nativeHost:relaunch` - restart the process with the same argv.
4//! VS Code calls this from `ILifecycleMainService.relaunch()` when an
5//! extension update is applied, the user picks "Restart to Apply", or
6//! the workbench triggers a self-restart after a crash.
7
8use serde_json::Value;
9use tauri::AppHandle;
10
11use crate::dev_log;
12
13pub async fn Relaunch(ApplicationHandle:AppHandle, _Arguments:Vec<Value>) -> Result<Value, String> {
14	dev_log!("lifecycle", "nativeHost:relaunch - restarting process");
15
16	// restart() calls std::process::exit internally - return type is `!`
17	// which coerces to Result<Value, String>, so no Ok() needed.
18	ApplicationHandle.restart()
19}