diff options
Diffstat (limited to 'crates/typst-cli/src')
| -rw-r--r-- | crates/typst-cli/src/compile.rs | 7 | ||||
| -rw-r--r-- | crates/typst-cli/src/package.rs | 2 | ||||
| -rw-r--r-- | crates/typst-cli/src/world.rs | 3 |
3 files changed, 5 insertions, 7 deletions
diff --git a/crates/typst-cli/src/compile.rs b/crates/typst-cli/src/compile.rs index 3250202b..9dfa4d41 100644 --- a/crates/typst-cli/src/compile.rs +++ b/crates/typst-cli/src/compile.rs @@ -7,9 +7,8 @@ use termcolor::{ColorChoice, StandardStream}; use typst::diag::{bail, SourceError, StrResult}; use typst::doc::Document; use typst::eval::eco_format; -use typst::file::FileId; use typst::geom::Color; -use typst::syntax::Source; +use typst::syntax::{FileId, Source}; use typst::World; use crate::args::{CompileCommand, DiagnosticFormat}; @@ -168,7 +167,7 @@ fn print_diagnostics( .map(|e| (eco_format!("hint: {e}")).into()) .collect(), ) - .with_labels(vec![Label::primary(error.span.id(), error.span.range(world))]); + .with_labels(vec![Label::primary(error.span.id(), world.range(error.span))]); term::emit(&mut w, &config, world, &diag)?; @@ -176,7 +175,7 @@ fn print_diagnostics( for point in error.trace { let message = point.v.to_string(); let help = Diagnostic::help().with_message(message).with_labels(vec![ - Label::primary(point.span.id(), point.span.range(world)), + Label::primary(point.span.id(), world.range(point.span)), ]); term::emit(&mut w, &config, world, &help)?; diff --git a/crates/typst-cli/src/package.rs b/crates/typst-cli/src/package.rs index 6853796b..4bde6524 100644 --- a/crates/typst-cli/src/package.rs +++ b/crates/typst-cli/src/package.rs @@ -5,7 +5,7 @@ use std::path::{Path, PathBuf}; use codespan_reporting::term::{self, termcolor}; use termcolor::WriteColor; use typst::diag::{PackageError, PackageResult}; -use typst::file::PackageSpec; +use typst::syntax::PackageSpec; use super::color_stream; diff --git a/crates/typst-cli/src/world.rs b/crates/typst-cli/src/world.rs index f09a3f6c..cfa96d36 100644 --- a/crates/typst-cli/src/world.rs +++ b/crates/typst-cli/src/world.rs @@ -10,9 +10,8 @@ use same_file::Handle; use siphasher::sip128::{Hasher128, SipHasher13}; use typst::diag::{FileError, FileResult, StrResult}; use typst::eval::{eco_format, Datetime, Library}; -use typst::file::FileId; use typst::font::{Font, FontBook}; -use typst::syntax::Source; +use typst::syntax::{FileId, Source}; use typst::util::{Bytes, PathExt}; use typst::World; |
