summaryrefslogtreecommitdiff
path: root/support/texlab/src/highlight/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/highlight/mod.rs
parent195ca7e0c377d83455867bdd8e409d4e1cf024ea (diff)
CTAN sync 202005280303
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
}
}