Mountain/Vine/Server/Notification/StatusBarMessage.rs
1#![allow(non_snake_case)]
2//! Cocoon → Mountain `statusBar.message` notification.
3//! Emitted when an extension calls `vscode.window.setStatusBarMessage`
4//! (one-shot text, optional auto-hide). Canonical channel is
5//! `sky://statusbar/set-message`.
6
7use serde_json::{Value, json};
8use tauri::Emitter;
9
10use crate::{Vine::Server::MountainVinegRPCService::MountainVinegRPCService, dev_log};
11
12pub async fn StatusBarMessage(Service:&MountainVinegRPCService, Parameter:&Value) {
13 let Text = Parameter.get("text").and_then(Value::as_str).unwrap_or("");
14 let HideAfter = Parameter.get("hideAfter").and_then(Value::as_u64);
15 if let Err(Error) = Service.ApplicationHandle().emit(
16 "sky://statusbar/set-message",
17 json!({
18 "text": Text,
19 "hideAfter": HideAfter,
20 }),
21 ) {
22 dev_log!(
23 "grpc",
24 "warn: [MountainVinegRPCService] sky://statusbar/set-message emit failed: {}",
25 Error
26 );
27 }
28}