Skip to main content

Mountain/RPC/CocoonService/
Save.rs

1//! Save Participants domain handlers for CocoonService.
2//!
3//! Typed gRPC RPCs: participate_in_save.
4
5use tonic::{Response, Status};
6use ::Vine::Generated::{ParticipateInSaveRequest, ParticipateInSaveResponse};
7
8use super::CocoonServiceImpl;
9use crate::dev_log;
10
11pub async fn Fn(
12	Service:&CocoonServiceImpl,
13
14	req:ParticipateInSaveRequest,
15) -> Result<Response<ParticipateInSaveResponse>, Status> {
16	dev_log!("cocoon", "[CocoonService] Participating in save for: {:?}", req.uri);
17
18	// Save participants are extension-registered onWillSaveTextDocument handlers.
19	// Cocoon invokes this when an extension wants to participate in a save.
20	// The extension has already computed its edits - they arrive via gRPC from
21	// the Cocoon extension host. For now, pass through with no edits since
22	// extension activation is not yet complete.
23	dev_log!("cocoon", "[CocoonService] Save reason: {:?}, uri: {:?}", req.reason, req.uri);
24
25	Ok(Response::new(ParticipateInSaveResponse { edits:Vec::new() }))
26}