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.rs37
1 files changed, 37 insertions, 0 deletions
diff --git a/support/texlab/src/highlight/mod.rs b/support/texlab/src/highlight/mod.rs
new file mode 100644
index 0000000000..c6cf1fcfb9
--- /dev/null
+++ b/support/texlab/src/highlight/mod.rs
@@ -0,0 +1,37 @@
+mod latex_label;
+
+use self::latex_label::LatexLabelHighlightProvider;
+use crate::workspace::*;
+use futures_boxed::boxed;
+use lsp_types::{DocumentHighlight, TextDocumentPositionParams};
+
+pub struct HighlightProvider {
+ provider: ConcatProvider<TextDocumentPositionParams, DocumentHighlight>,
+}
+
+impl HighlightProvider {
+ pub fn new() -> Self {
+ Self {
+ provider: ConcatProvider::new(vec![Box::new(LatexLabelHighlightProvider)]),
+ }
+ }
+}
+
+impl Default for HighlightProvider {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+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
+ }
+}