Mountain/RPC/CocoonService/Provider/
ProvideCallHierarchyOutgoingCalls.rs1#![allow(non_snake_case)]
2
3use serde_json::json;
6use tonic::{Response, Status};
7use CommonLibrary::LanguageFeature::LanguageFeatureProviderRegistry::LanguageFeatureProviderRegistry;
8
9use crate::{
10 RPC::CocoonService::CocoonServiceImpl,
11 Vine::Generated::{ProvideCallHierarchyRequest, ProvideCallHierarchyResponse},
12 dev_log,
13};
14
15pub async fn Fn(
16 Service:&CocoonServiceImpl,
17 Request:ProvideCallHierarchyRequest,
18) -> Result<Response<ProvideCallHierarchyResponse>, Status> {
19 dev_log!("cocoon", "[CocoonService] Providing call hierarchy outgoing");
20 let ItemDTO = json!({
21 "name": Request.item.as_ref().map(|I| I.name.as_str()).unwrap_or(""),
22 "uri": Request.uri.as_ref().map(|U| U.value.as_str()).unwrap_or(""),
23 });
24 match Service.environment.ProvideCallHierarchyOutgoingCalls(ItemDTO).await {
25 Ok(_) => Ok(Response::new(<ProvideCallHierarchyResponse>::default())),
26 Err(Error) => Err(Status::internal(format!("call hierarchy outgoing failed: {}", Error))),
27 }
28}