summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/typst/src/foundations/styles.rs4
-rw-r--r--crates/typst/src/introspection/counter.rs8
-rw-r--r--crates/typst/src/introspection/locate.rs4
-rw-r--r--crates/typst/src/introspection/query.rs4
-rw-r--r--crates/typst/src/introspection/state.rs8
-rw-r--r--crates/typst/src/layout/measure.rs4
6 files changed, 24 insertions, 8 deletions
diff --git a/crates/typst/src/foundations/styles.rs b/crates/typst/src/foundations/styles.rs
index 48009c8c..db870d62 100644
--- a/crates/typst/src/foundations/styles.rs
+++ b/crates/typst/src/foundations/styles.rs
@@ -46,7 +46,9 @@ pub fn style(
func: Func,
) -> Content {
engine.sink.warn(warning!(
- span, "`style` is deprecated";
+ span,
+ id: "deprecated",
+ message: "`style` is deprecated";
hint: "use a `context` expression instead"
));
diff --git a/crates/typst/src/introspection/counter.rs b/crates/typst/src/introspection/counter.rs
index 2aefb68e..9829d42e 100644
--- a/crates/typst/src/introspection/counter.rs
+++ b/crates/typst/src/introspection/counter.rs
@@ -465,7 +465,9 @@ impl Counter {
self.display_impl(engine, loc, numbering, both, context.styles().ok())
} else {
engine.sink.warn(warning!(
- span, "`counter.display` without context is deprecated";
+ span,
+ id: "deprecated",
+ message: "`counter.display` without context is deprecated";
hint: "use it in a `context` expression instead"
));
@@ -523,7 +525,9 @@ impl Counter {
context.location().at(span)?;
} else {
engine.sink.warn(warning!(
- span, "calling `counter.final` with a location is deprecated";
+ span,
+ id: "deprecated",
+ message: "calling `counter.final` with a location is deprecated";
hint: "try removing the location argument"
));
}
diff --git a/crates/typst/src/introspection/locate.rs b/crates/typst/src/introspection/locate.rs
index 8991ae9b..15e51ce1 100644
--- a/crates/typst/src/introspection/locate.rs
+++ b/crates/typst/src/introspection/locate.rs
@@ -58,7 +58,9 @@ pub fn locate(
}
LocateInput::Func(func) => {
engine.sink.warn(warning!(
- span, "`locate` with callback function is deprecated";
+ span,
+ id: "deprecated",
+ message: "`locate` with callback function is deprecated";
hint: "use a `context` expression instead"
));
diff --git a/crates/typst/src/introspection/query.rs b/crates/typst/src/introspection/query.rs
index 07f761a8..79991990 100644
--- a/crates/typst/src/introspection/query.rs
+++ b/crates/typst/src/introspection/query.rs
@@ -161,7 +161,9 @@ pub fn query(
context.introspect()?;
} else {
engine.sink.warn(warning!(
- span, "calling `query` with a location is deprecated";
+ span,
+ id: "deprecated",
+ message: "calling `query` with a location is deprecated";
hint: "try removing the location argument"
));
}
diff --git a/crates/typst/src/introspection/state.rs b/crates/typst/src/introspection/state.rs
index a88ed526..a1b87199 100644
--- a/crates/typst/src/introspection/state.rs
+++ b/crates/typst/src/introspection/state.rs
@@ -335,7 +335,9 @@ impl State {
context.location().at(span)?;
} else {
engine.sink.warn(warning!(
- span, "calling `state.final` with a location is deprecated";
+ span,
+ id: "deprecated",
+ message: "calling `state.final` with a location is deprecated";
hint: "try removing the location argument"
));
}
@@ -382,7 +384,9 @@ impl State {
func: Option<Func>,
) -> Content {
engine.sink.warn(warning!(
- span, "`state.display` is deprecated";
+ span,
+ id: "deprecated",
+ message: "`state.display` is deprecated";
hint: "use `state.get` in a `context` expression instead"
));
diff --git a/crates/typst/src/layout/measure.rs b/crates/typst/src/layout/measure.rs
index cb08e591..8a4c1694 100644
--- a/crates/typst/src/layout/measure.rs
+++ b/crates/typst/src/layout/measure.rs
@@ -84,7 +84,9 @@ pub fn measure(
let styles = match &styles {
Some(styles) => {
engine.sink.warn(warning!(
- span, "calling `measure` with a styles argument is deprecated";
+ span,
+ id: "deprecated",
+ message: "calling `measure` with a styles argument is deprecated";
hint: "try removing the styles argument"
));
StyleChain::new(styles)