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