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