Skip to main content

Mountain/Vine/Server/Notification/
WorkspaceApplyEdit.rs

1//! Cocoon → Mountain `workspace.applyEdit` notification.
2//! Fires when an extension calls `vscode.workspace.applyEdit(edit)`
3//! with a multi-file `WorkspaceEdit`. The payload shape matches VS
4//! Code's `IWorkspaceEdit`; Sky's BulkEditService applies the edits
5//! against open models.
6
7use serde_json::Value;
8use tauri::Emitter;
9
10use crate::{Vine::Server::MountainVinegRPCService::MountainVinegRPCService, dev_log};
11
12pub async fn WorkspaceApplyEdit(Service:&MountainVinegRPCService, Parameter:&Value) {
13	if let Err(Error) = Service.ApplicationHandle().emit("sky://workspace/applyEdit", Parameter) {
14		dev_log!(
15			"grpc",
16			"warn: [MountainVinegRPCService] sky://workspace/applyEdit emit failed: {}",
17			Error
18		);
19	}
20}