Skip to main content

DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/RPC/CocoonService/Debug/
StopDebugging.rs

1//! Stop an active debug session. Emits `sky://debug/sessionEnd` (NOT
2//! `/stop` - Sky listens on the former at `SkyBridge.ts:2234`;
3//! `DebugProvider.rs:351` emits the same channel from the lifecycle path).
4
5use serde_json::json;
6use tauri::Emitter;
7use tonic::{Response, Status};
8
9use crate::{
10	RPC::CocoonService::CocoonServiceImpl,
11	Vine::Generated::{Empty, StopDebuggingRequest},
12	dev_log,
13};
14
15pub async fn Fn(Service:&CocoonServiceImpl, Request:StopDebuggingRequest) -> Result<Response<Empty>, Status> {
16	dev_log!("cocoon", "[CocoonService] stop_debugging: session={}", Request.session_id);
17
18	let _ = Service
19		.environment
20		.ApplicationHandle
21		.emit("sky://debug/sessionEnd", json!({ "sessionId": Request.session_id }));
22
23	Ok(Response::new(Empty {}))
24}