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