Skip to main content

Mountain/RPC/CocoonService/Provider/
RegisterSemanticTokensProvider.rs

1//! Register a Cocoon-side semantic-tokens provider. Uses the
2//! semantic-tokens-specific request shape (carries the legend).
3
4use tonic::{Response, Status};
5use CommonLibrary::LanguageFeature::DTO::ProviderType::ProviderType;
6use ::Vine::Generated::{Empty, RegisterSemanticTokensProviderRequest};
7
8use crate::{RPC::CocoonService::CocoonServiceImpl, dev_log};
9
10pub async fn Fn(
11	Service:&CocoonServiceImpl,
12
13	Request:RegisterSemanticTokensProviderRequest,
14) -> Result<Response<Empty>, Status> {
15	dev_log!("cocoon", "[CocoonService] Registering Semantic Tokens Provider");
16
17	Service.RegisterProvider(
18		Request.handle,
19		ProviderType::SemanticTokens,
20		&Request.language_selector,
21		&Request.extension_id,
22	);
23
24	Ok(Response::new(Empty {}))
25}