Skip to main content

Mountain/RPC/CocoonService/
Save.rs

1#![allow(non_snake_case)]
2//! Save Participants domain handlers for CocoonService.
3//!
4//! Typed gRPC RPCs: participate_in_save.
5
6use tonic::{Response, Status};
7
8use super::CocoonServiceImpl;
9use crate::{
10	Vine::Generated::{ParticipateInSaveRequest, ParticipateInSaveResponse},
11	dev_log,
12};
13
14pub async fn ParticipateInSave(
15	Service:&CocoonServiceImpl,
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}