Mountain/IPC/WindServiceHandlers/NativeHost/ClipboardReadFindText.rs
1#![allow(unused_variables, dead_code, unused_imports)]
2
3//! Wire method: `nativeHost:readClipboardFindText`.
4//! macOS has a separate find pasteboard; reuse the general clipboard for
5//! parity with VS Code on Linux/Windows.
6
7use serde_json::{Value, json};
8
9pub async fn Fn(_Arguments:Vec<Value>) -> Result<Value, String> {
10 match arboard::Clipboard::new() {
11 Ok(mut Cb) => Ok(json!(Cb.get_text().unwrap_or_default())),
12
13 Err(_) => Ok(json!("")),
14 }
15}