Skip to main content

Mountain/IPC/WindServiceHandlers/ExtensionHost/
StarterStart.rs

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