summaryrefslogtreecommitdiff
path: root/support/texlab/src/highlight/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/src/highlight/mod.rs')
-rw-r--r--support/texlab/src/highlight/mod.rs17
1 files changed, 8 insertions, 9 deletions
diff --git a/support/texlab/src/highlight/mod.rs b/support/texlab/src/highlight/mod.rs
index c6cf1fcfb9..e47a7f99c2 100644
--- a/support/texlab/src/highlight/mod.rs
+++ b/support/texlab/src/highlight/mod.rs
@@ -1,9 +1,11 @@
mod latex_label;
use self::latex_label::LatexLabelHighlightProvider;
-use crate::workspace::*;
-use futures_boxed::boxed;
-use lsp_types::{DocumentHighlight, TextDocumentPositionParams};
+use crate::{
+ feature::{ConcatProvider, FeatureProvider, FeatureRequest},
+ protocol::{DocumentHighlight, TextDocumentPositionParams},
+};
+use async_trait::async_trait;
pub struct HighlightProvider {
provider: ConcatProvider<TextDocumentPositionParams, DocumentHighlight>,
@@ -23,15 +25,12 @@ impl Default for HighlightProvider {
}
}
+#[async_trait]
impl FeatureProvider for HighlightProvider {
type Params = TextDocumentPositionParams;
type Output = Vec<DocumentHighlight>;
- #[boxed]
- async fn execute<'a>(
- &'a self,
- request: &'a FeatureRequest<TextDocumentPositionParams>,
- ) -> Vec<DocumentHighlight> {
- self.provider.execute(request).await
+ async fn execute<'a>(&'a self, req: &'a FeatureRequest<Self::Params>) -> Self::Output {
+ self.provider.execute(req).await
}
}