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.rs25
1 files changed, 14 insertions, 11 deletions
diff --git a/support/texlab/src/link/mod.rs b/support/texlab/src/link/mod.rs
index 33d5556332..934975f060 100644
--- a/support/texlab/src/link/mod.rs
+++ b/support/texlab/src/link/mod.rs
@@ -1,9 +1,12 @@
+mod latex_import;
mod latex_include;
-use crate::link::latex_include::LatexIncludeLinkProvider;
-use crate::workspace::*;
-use futures_boxed::boxed;
-use lsp_types::{DocumentLink, DocumentLinkParams};
+use self::{latex_import::LatexImportLinkProvider, latex_include::LatexIncludeLinkProvider};
+use crate::{
+ feature::{ConcatProvider, FeatureProvider, FeatureRequest},
+ protocol::{DocumentLink, DocumentLinkParams},
+};
+use async_trait::async_trait;
pub struct LinkProvider {
provider: ConcatProvider<DocumentLinkParams, DocumentLink>,
@@ -12,7 +15,10 @@ pub struct LinkProvider {
impl LinkProvider {
pub fn new() -> Self {
Self {
- provider: ConcatProvider::new(vec![Box::new(LatexIncludeLinkProvider)]),
+ provider: ConcatProvider::new(vec![
+ Box::new(LatexImportLinkProvider),
+ Box::new(LatexIncludeLinkProvider),
+ ]),
}
}
}
@@ -23,15 +29,12 @@ impl Default for LinkProvider {
}
}
+#[async_trait]
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
+ async fn execute<'a>(&'a self, req: &'a FeatureRequest<Self::Params>) -> Self::Output {
+ self.provider.execute(req).await
}
}