diff options
Diffstat (limited to 'crates/typst-ide')
| -rw-r--r-- | crates/typst-ide/Cargo.toml | 1 | ||||
| -rw-r--r-- | crates/typst-ide/src/analyze.rs | 5 | ||||
| -rw-r--r-- | crates/typst-ide/src/complete.rs | 1 | ||||
| -rw-r--r-- | crates/typst-ide/src/lib.rs | 2 | ||||
| -rw-r--r-- | crates/typst-ide/src/tooltip.rs | 2 |
5 files changed, 6 insertions, 5 deletions
diff --git a/crates/typst-ide/Cargo.toml b/crates/typst-ide/Cargo.toml index 4e87f99b..3c98e9b8 100644 --- a/crates/typst-ide/Cargo.toml +++ b/crates/typst-ide/Cargo.toml @@ -14,6 +14,7 @@ readme = { workspace = true } [dependencies] typst = { workspace = true } +typst-eval = { workspace = true } comemo = { workspace = true } ecow = { workspace = true } if_chain = { workspace = true } diff --git a/crates/typst-ide/src/analyze.rs b/crates/typst-ide/src/analyze.rs index c3779556..75ffaede 100644 --- a/crates/typst-ide/src/analyze.rs +++ b/crates/typst-ide/src/analyze.rs @@ -1,12 +1,12 @@ use comemo::Track; use ecow::{eco_vec, EcoString, EcoVec}; use typst::engine::{Engine, Route, Sink, Traced}; -use typst::eval::Vm; use typst::foundations::{Context, Label, Scopes, Styles, Value}; use typst::introspection::Introspector; use typst::model::{BibliographyElem, Document}; use typst::syntax::{ast, LinkedNode, Span, SyntaxKind}; use typst::World; +use typst_eval::Vm; /// Try to determine a set of possible values for an expression. pub fn analyze_expr( @@ -58,6 +58,7 @@ pub fn analyze_import(world: &dyn World, source: &LinkedNode) -> Option<Value> { let traced = Traced::default(); let mut sink = Sink::new(); let engine = Engine { + routines: &typst::ROUTINES, world: world.track(), introspector: introspector.track(), traced: traced.track(), @@ -73,7 +74,7 @@ pub fn analyze_import(world: &dyn World, source: &LinkedNode) -> Option<Value> { Span::detached(), ); - typst::eval::import(&mut vm, source, source_span, true) + typst_eval::import(&mut vm, source, source_span, true) .ok() .map(Value::Module) } diff --git a/crates/typst-ide/src/complete.rs b/crates/typst-ide/src/complete.rs index d534f55c..cde4d1e3 100644 --- a/crates/typst-ide/src/complete.rs +++ b/crates/typst-ide/src/complete.rs @@ -1353,7 +1353,6 @@ impl<'a> CompletionContext<'a> { #[cfg(test)] mod tests { - use super::autocomplete; use crate::tests::TestWorld; diff --git a/crates/typst-ide/src/lib.rs b/crates/typst-ide/src/lib.rs index 63ba6f75..f09e6ac5 100644 --- a/crates/typst-ide/src/lib.rs +++ b/crates/typst-ide/src/lib.rs @@ -191,7 +191,7 @@ mod tests { // Set page width to 120pt with 10pt margins, so that the inner page is // exactly 100pt wide. Page height is unbounded and font size is 10pt so // that it multiplies to nice round numbers. - let mut lib = Library::default(); + let mut lib = typst::Library::default(); lib.styles .set(PageElem::set_width(Smart::Custom(Abs::pt(120.0).into()))); lib.styles.set(PageElem::set_height(Smart::Auto)); diff --git a/crates/typst-ide/src/tooltip.rs b/crates/typst-ide/src/tooltip.rs index 532cda39..df93d1dc 100644 --- a/crates/typst-ide/src/tooltip.rs +++ b/crates/typst-ide/src/tooltip.rs @@ -3,13 +3,13 @@ use std::fmt::Write; use ecow::{eco_format, EcoString}; use if_chain::if_chain; use typst::engine::Sink; -use typst::eval::CapturesVisitor; use typst::foundations::{repr, Capturer, CastInfo, Repr, Value}; use typst::layout::Length; use typst::model::Document; use typst::syntax::{ast, LinkedNode, Side, Source, SyntaxKind}; use typst::utils::{round_with_precision, Numeric}; use typst::World; +use typst_eval::CapturesVisitor; use crate::{analyze_expr, analyze_labels, plain_docs_sentence, summarize_font_family}; |
