Skip to main content

DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/IPC/WindServiceHandlers/NativeHost/
Relaunch.rs

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