summaryrefslogtreecommitdiff
path: root/support/texlab/src/folding/mod.rs
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-05-28 03:03:21 +0000
committerNorbert Preining <norbert@preining.info>2020-05-28 03:03:21 +0000
commit745892fbddea56040139108277e728b53fd8fc11 (patch)
tree15e55e299b38fccdabce8364f1fbf4f02ef37994 /support/texlab/src/folding/mod.rs
parent195ca7e0c377d83455867bdd8e409d4e1cf024ea (diff)
CTAN sync 202005280303
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
}
}