Mountain/Vine/Server/Notification/DebugLifecycle.rs
1#![allow(non_snake_case)]
2//! Cocoon → Mountain `debug.addBreakpoints` / `debug.removeBreakpoints` /
3//! `debug.consoleAppend` notifications. Fans on `sky://debug/<suffix>`
4//! so the Sky-side debug view picks up breakpoint changes and console
5//! output from the extension's `vscode.debug.*` surface.
6
7use serde_json::Value;
8use tauri::Emitter;
9
10use crate::{Vine::Server::MountainVinegRPCService::MountainVinegRPCService, dev_log};
11
12pub async fn DebugLifecycle(Service:&MountainVinegRPCService, MethodName:&str, Parameter:&Value) {
13 let EventName = format!("sky://debug/{}", &MethodName["debug.".len()..]);
14 if let Err(Error) = Service.ApplicationHandle().emit(&EventName, Parameter) {
15 dev_log!("grpc", "warn: [MountainVinegRPCService] {} emit failed: {}", EventName, Error);
16 }
17}