Skip to main content

CommonLibrary/LanguageFeature/
ProvideCallHierarchy.rs

1//! # ProvideCallHierarchy Effect
2//!
3//! Defines the `ActionEffect` for requesting call hierarchy incoming calls from
4//! a language feature provider.
5
6use std::sync::Arc;
7
8use serde_json::Value;
9
10use super::LanguageFeatureProviderRegistry::LanguageFeatureProviderRegistry;
11use crate::{Effect::ActionEffect::ActionEffect, Error::CommonError::CommonError};
12
13/// Creates an effect that, when executed, will request call hierarchy incoming
14/// calls.
15pub fn ProvideCallHierarchy(
16	ItemDTO:Value,
17) -> ActionEffect<Arc<dyn LanguageFeatureProviderRegistry>, CommonError, Option<Value>> {
18	ActionEffect::New(Arc::new(move |Registry:Arc<dyn LanguageFeatureProviderRegistry>| {
19		let ItemDTOClone = ItemDTO.clone();
20
21		Box::pin(async move { Registry.ProvideCallHierarchyIncomingCalls(ItemDTOClone).await })
22	}))
23}