DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/RPC/CocoonService/Provider/
ProvideCallHierarchyOutgoingCalls.rs1use serde_json::json;
4use tonic::{Response, Status};
5use CommonLibrary::LanguageFeature::LanguageFeatureProviderRegistry::LanguageFeatureProviderRegistry;
6
7use crate::{
8 RPC::CocoonService::CocoonServiceImpl,
9 Vine::Generated::{ProvideCallHierarchyRequest, ProvideCallHierarchyResponse},
10 dev_log,
11};
12
13pub async fn Fn(
14 Service:&CocoonServiceImpl,
15
16 Request:ProvideCallHierarchyRequest,
17) -> Result<Response<ProvideCallHierarchyResponse>, Status> {
18 dev_log!("cocoon", "[CocoonService] Providing call hierarchy outgoing");
19
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
25 match Service.environment.ProvideCallHierarchyOutgoingCalls(ItemDTO).await {
26 Ok(_) => Ok(Response::new(<ProvideCallHierarchyResponse>::default())),
27
28 Err(Error) => Err(Status::internal(format!("call hierarchy outgoing failed: {}", Error))),
29 }
30}