summaryrefslogtreecommitdiff
path: root/support/texlab/src/folding/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/src/folding/mod.rs')
-rw-r--r--support/texlab/src/folding/mod.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/support/texlab/src/folding/mod.rs b/support/texlab/src/folding/mod.rs
index 52c8149a31..448e3d26fc 100644
--- a/support/texlab/src/folding/mod.rs
+++ b/support/texlab/src/folding/mod.rs
@@ -1,13 +1,16 @@
-mod bibtex_declaration;
-mod latex_environment;
+mod bibtex_decl;
+mod latex_env;
mod latex_section;
-use self::bibtex_declaration::BibtexDeclarationFoldingProvider;
-use self::latex_environment::LatexEnvironmentFoldingProvider;
-use self::latex_section::LatexSectionFoldingProvider;
-use crate::workspace::*;
-use futures_boxed::boxed;
-use lsp_types::{FoldingRange, FoldingRangeParams};
+use self::{
+ bibtex_decl::BibtexDeclarationFoldingProvider, latex_env::LatexEnvironmentFoldingProvider,
+ latex_section::LatexSectionFoldingProvider,
+};
+use crate::{
+ feature::{ConcatProvider, FeatureProvider, FeatureRequest},
+ protocol::{FoldingRange, FoldingRangeParams},
+};
+use async_trait::async_trait;
pub struct FoldingProvider {
provider: ConcatProvider<FoldingRangeParams, FoldingRange>,
@@ -31,15 +34,12 @@ impl Default for FoldingProvider {
}
}
+#[async_trait]
impl FeatureProvider for FoldingProvider {
type Params = FoldingRangeParams;
type Output = Vec<FoldingRange>;
- #[boxed]
- async fn execute<'a>(
- &'a self,
- request: &'a FeatureRequest<FoldingRangeParams>,
- ) -> Vec<FoldingRange> {
- self.provider.execute(request).await
+ async fn execute<'a>(&'a self, req: &'a FeatureRequest<Self::Params>) -> Self::Output {
+ self.provider.execute(req).await
}
}