Mountain/Vine/Server/Notification/StatusBarLifecycle.rs
1//! Cocoon → Mountain `statusBar.update` / `statusBar.dispose` notifications.
2//! Each `vscode.window.createStatusBarItem(...)` instance fires
3//! `statusBar.update` with text / tooltip / alignment; `statusBar.dispose`
4//! removes the item. Sky's workbench status-bar renderer subscribes to
5//! the downstream `sky://statusbar/*` family.
6//!
7//! Canonical channel prefix is `sky://statusbar/` (no hyphen) to match
8//! every other emit site in the statusbar group; the legacy
9//! `sky://status-bar/*` fork has been retired.
10
11use serde_json::Value;
12use tauri::Emitter;
13
14use crate::{Vine::Server::MountainVinegRPCService::MountainVinegRPCService, dev_log};
15
16pub async fn StatusBarLifecycle(Service:&MountainVinegRPCService, MethodName:&str, Parameter:&Value) {
17 let EventName = format!("sky://statusbar/{}", &MethodName["statusBar.".len()..]);
18
19 if let Err(Error) = Service.ApplicationHandle().emit(&EventName, Parameter) {
20 dev_log!("grpc", "warn: [MountainVinegRPCService] {} emit failed: {}", EventName, Error);
21 }
22}