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