summaryrefslogtreecommitdiff
path: root/support/texlab/src/tex/tectonic.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/src/tex/tectonic.rs')
-rw-r--r--support/texlab/src/tex/tectonic.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/support/texlab/src/tex/tectonic.rs b/support/texlab/src/tex/tectonic.rs
new file mode 100644
index 0000000000..1c19466830
--- /dev/null
+++ b/support/texlab/src/tex/tectonic.rs
@@ -0,0 +1,36 @@
+use super::{
+ compile::{Artifacts, CompileError, CompileParams, Compiler},
+ kpsewhich::{KpsewhichError, Resolver},
+ Distribution, DistributionKind,
+};
+use async_trait::async_trait;
+use std::sync::Arc;
+
+#[derive(Debug, Default)]
+pub struct Tectonic;
+
+#[async_trait]
+impl Distribution for Tectonic {
+ fn kind(&self) -> DistributionKind {
+ DistributionKind::Tectonic
+ }
+
+ async fn compile<'a>(&'a self, params: CompileParams<'a>) -> Result<Artifacts, CompileError> {
+ let args = [params.file_name];
+ let compiler = Compiler {
+ executable: "tectonic",
+ args: &args,
+ file_name: params.file_name,
+ timeout: params.timeout,
+ };
+ compiler.compile(params.code).await
+ }
+
+ async fn load(&self) -> Result<(), KpsewhichError> {
+ Ok(())
+ }
+
+ async fn resolver(&self) -> Arc<Resolver> {
+ Arc::new(Resolver::default())
+ }
+}