diff options
Diffstat (limited to 'crates/typst-cli')
| -rw-r--r-- | crates/typst-cli/Cargo.toml | 4 | ||||
| -rw-r--r-- | crates/typst-cli/src/main.rs | 3 | ||||
| -rw-r--r-- | crates/typst-cli/src/query.rs | 3 | ||||
| -rw-r--r-- | crates/typst-cli/src/timings.rs | 3 | ||||
| -rw-r--r-- | crates/typst-cli/src/world.rs | 4 |
5 files changed, 9 insertions, 8 deletions
diff --git a/crates/typst-cli/Cargo.toml b/crates/typst-cli/Cargo.toml index 1c622d1e..855d7bee 100644 --- a/crates/typst-cli/Cargo.toml +++ b/crates/typst-cli/Cargo.toml @@ -19,7 +19,7 @@ doc = false [dependencies] typst = { workspace = true } -typst-assets = { workspace = true, features = ["fonts"] } +typst-eval = { workspace = true } typst-kit = { workspace = true } typst-macros = { workspace = true } typst-pdf = { workspace = true } @@ -28,8 +28,8 @@ typst-svg = { workspace = true } typst-timing = { workspace = true } chrono = { workspace = true } clap = { workspace = true } -color-print = { workspace = true } codespan-reporting = { workspace = true } +color-print = { workspace = true } comemo = { workspace = true } dirs = { workspace = true } ecow = { workspace = true } diff --git a/crates/typst-cli/src/main.rs b/crates/typst-cli/src/main.rs index b14e687e..464ad624 100644 --- a/crates/typst-cli/src/main.rs +++ b/crates/typst-cli/src/main.rs @@ -94,9 +94,10 @@ fn print_error(msg: &str) -> io::Result<()> { #[cfg(not(feature = "self-update"))] mod update { - use crate::args::UpdateCommand; use typst::diag::{bail, StrResult}; + use crate::args::UpdateCommand; + pub fn update(_: &UpdateCommand) -> StrResult<()> { bail!( "self-updating is not enabled for this executable, \ diff --git a/crates/typst-cli/src/query.rs b/crates/typst-cli/src/query.rs index ef3c7951..90d99a5a 100644 --- a/crates/typst-cli/src/query.rs +++ b/crates/typst-cli/src/query.rs @@ -2,11 +2,11 @@ use comemo::Track; use ecow::{eco_format, EcoString}; use serde::Serialize; use typst::diag::{bail, HintedStrResult, StrResult, Warned}; -use typst::eval::{eval_string, EvalMode}; use typst::foundations::{Content, IntoValue, LocatableSelector, Scope}; use typst::model::Document; use typst::syntax::Span; use typst::World; +use typst_eval::{eval_string, EvalMode}; use crate::args::{QueryCommand, SerializationFormat}; use crate::compile::print_diagnostics; @@ -56,6 +56,7 @@ fn retrieve( document: &Document, ) -> HintedStrResult<Vec<Content>> { let selector = eval_string( + &typst::ROUTINES, world.track(), &command.selector, Span::detached(), diff --git a/crates/typst-cli/src/timings.rs b/crates/typst-cli/src/timings.rs index df7665b7..4446bbf9 100644 --- a/crates/typst-cli/src/timings.rs +++ b/crates/typst-cli/src/timings.rs @@ -72,7 +72,8 @@ impl Timer { let writer = BufWriter::with_capacity(1 << 20, file); typst_timing::export_json(writer, |span| { - resolve_span(world, span).unwrap_or_else(|| ("unknown".to_string(), 0)) + resolve_span(world, Span::from_raw(span)) + .unwrap_or_else(|| ("unknown".to_string(), 0)) })?; Ok(output) diff --git a/crates/typst-cli/src/world.rs b/crates/typst-cli/src/world.rs index bb491c02..b790f41a 100644 --- a/crates/typst-cli/src/world.rs +++ b/crates/typst-cli/src/world.rs @@ -16,7 +16,7 @@ use typst::utils::LazyHash; use typst::{Library, World}; use typst_kit::fonts::{FontSlot, Fonts}; use typst_kit::package::PackageStorage; -use typst_timing::{timed, TimingScope}; +use typst_timing::timed; use crate::args::{Input, SharedArgs}; use crate::compile::ExportCache; @@ -285,8 +285,6 @@ impl FileSlot { self.source.get_or_init( || read(self.id, project_root, package_storage), |data, prev| { - let name = if prev.is_some() { "reparsing file" } else { "parsing file" }; - let _scope = TimingScope::new(name, None); let text = decode_utf8(&data)?; if let Some(mut prev) = prev { prev.replace(text); |
