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