summaryrefslogtreecommitdiff
path: root/crates/typst-syntax/src/source.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-syntax/src/source.rs')
-rw-r--r--crates/typst-syntax/src/source.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/typst-syntax/src/source.rs b/crates/typst-syntax/src/source.rs
index a2ccb5bb..3454a265 100644
--- a/crates/typst-syntax/src/source.rs
+++ b/crates/typst-syntax/src/source.rs
@@ -32,6 +32,7 @@ struct Repr {
impl Source {
/// Create a new source file.
pub fn new(id: FileId, text: String) -> Self {
+ let _scope = typst_timing::TimingScope::new("create source");
let mut root = parse(&text);
root.numberize(id, Span::FULL).unwrap();
Self(Arc::new(Repr {
@@ -75,6 +76,7 @@ impl Source {
///
/// Returns the range in the new source that was ultimately reparsed.
pub fn replace(&mut self, new: &str) -> Range<usize> {
+ let _scope = typst_timing::TimingScope::new("replace source");
let old = self.text();
let mut prefix =