DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/IPC/WindServiceHandlers/ExtensionHost/StarterStart.rs
1//! Wire method: `extensionHostStarter:start`.
2//! Returns Cocoon's real PID so debuggers attach to the correct Node.js
3//! process. Falls back to Mountain's PID only if Cocoon has not spawned yet.
4
5use serde_json::{Value, json};
6
7pub async fn Fn(_Arguments:Vec<Value>) -> Result<Value, String> {
8 let Pid = crate::ProcessManagement::CocoonManagement::GetCocoonPid().unwrap_or_else(std::process::id);
9
10 crate::dev_log!("exthost", "extensionHostStarter:start pid={}", Pid);
11
12 Ok(json!({ "pid": Pid }))
13}