Skip to main content

Vine/Server/Notification/
SetStatusBarText.rs

1//! Cocoon → `setStatusBarText` notification.
2//! Pure text-only fast path for `vscode.window.setStatusBarMessage(...)`.
3//! Distinct from the typed `statusBar.update` notification (which carries
4//! colour/tooltip/command fields). Forwards onto `sky://statusbar/set-entry`.
5
6use serde_json::{Value, json};
7
8use crate::{Host::VineHost, dev_log};
9
10pub async fn SetStatusBarText(Host:&dyn VineHost, Parameter:&Value) {
11	let Id = Parameter.get("id").and_then(Value::as_str).unwrap_or("");
12
13	let Text = Parameter.get("text").and_then(Value::as_str).unwrap_or("");
14
15	let Tooltip = Parameter.get("tooltip").and_then(Value::as_str).unwrap_or("");
16
17	Host.EmitToRenderer(
18		"sky://statusbar/set-entry",
19		json!({
20			"id": Id,
21			"text": Text,
22			"tooltip": Tooltip,
23		}),
24	);
25
26	dev_log!("grpc", "[StatusBar] set-text id={} len={}", Id, Text.len());
27}