diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-11-11 15:11:44 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2024-11-13 10:21:40 +0100 |
| commit | 525154a730dfdb224fe2ced3dae0cfb33114fafa (patch) | |
| tree | c81f490cb6b2091146d787fdc044f7be530d8181 /crates/typst-syntax/src/source.rs | |
| parent | 5625914872b2824388ce65f3fb184d913f29cbff (diff) | |
Add support for raw range spans
Diffstat (limited to 'crates/typst-syntax/src/source.rs')
| -rw-r--r-- | crates/typst-syntax/src/source.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/typst-syntax/src/source.rs b/crates/typst-syntax/src/source.rs index 3454a265..6ff94c73 100644 --- a/crates/typst-syntax/src/source.rs +++ b/crates/typst-syntax/src/source.rs @@ -166,6 +166,8 @@ impl Source { /// Get the byte range for the given span in this file. /// /// Returns `None` if the span does not point into this source file. + /// + /// Typically, it's easier to use `WorldExt::range` instead. pub fn range(&self, span: Span) -> Option<Range<usize>> { Some(self.find(span)?.range()) } |
