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
18 Request:ProvideCallHierarchyRequest,
19) -> Result<Response<ProvideCallHierarchyResponse>, Status> {
20 dev_log!("cocoon", "[CocoonService] Providing call hierarchy outgoing");
21
22 let ItemDTO = json!({
23 "name": Request.item.as_ref().map(|I| I.name.as_str()).unwrap_or(""),
24 "uri": Request.uri.as_ref().map(|U| U.value.as_str()).unwrap_or(""),
25 });
26
27 match Service.environment.ProvideCallHierarchyOutgoingCalls(ItemDTO).await {
28 Ok(_) => Ok(Response::new(<ProvideCallHierarchyResponse>::default())),
29
30 Err(Error) => Err(Status::internal(format!("call hierarchy outgoing failed: {}", Error))),
31 }
32}