summaryrefslogtreecommitdiff
path: root/support/texlab/src/link/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/src/link/mod.rs')
-rw-r--r--support/texlab/src/link/mod.rs37
1 files changed, 37 insertions, 0 deletions
diff --git a/support/texlab/src/link/mod.rs b/support/texlab/src/link/mod.rs
new file mode 100644
index 0000000000..33d5556332
--- /dev/null
+++ b/support/texlab/src/link/mod.rs
@@ -0,0 +1,37 @@
+mod latex_include;
+
+use crate::link::latex_include::LatexIncludeLinkProvider;
+use crate::workspace::*;
+use futures_boxed::boxed;
+use lsp_types::{DocumentLink, DocumentLinkParams};
+
+pub struct LinkProvider {
+ provider: ConcatProvider<DocumentLinkParams, DocumentLink>,
+}
+
+impl LinkProvider {
+ pub fn new() -> Self {
+ Self {
+ provider: ConcatProvider::new(vec![Box::new(LatexIncludeLinkProvider)]),
+ }
+ }
+}
+
+impl Default for LinkProvider {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+impl FeatureProvider for LinkProvider {
+ type Params = DocumentLinkParams;
+ type Output = Vec<DocumentLink>;
+
+ #[boxed]
+ async fn execute<'a>(
+ &'a self,
+ request: &'a FeatureRequest<DocumentLinkParams>,
+ ) -> Vec<DocumentLink> {
+ self.provider.execute(request).await
+ }
+}