aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_syntax/src/syntax_text.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/syntax_text.rs b/crates/ra_syntax/src/syntax_text.rs
index 844bd3e13..939f2c02f 100644
--- a/crates/ra_syntax/src/syntax_text.rs
+++ b/crates/ra_syntax/src/syntax_text.rs
@@ -61,6 +61,10 @@ impl<'a> SyntaxText<'a> {
61 self.range.len() 61 self.range.len()
62 } 62 }
63 63
64 pub fn is_empty(&self) -> bool {
65 self.range.is_empty()
66 }
67
64 /// NB, the offsets here are absolute, and this probably doesn't make sense! 68 /// NB, the offsets here are absolute, and this probably doesn't make sense!
65 pub fn slice(&self, range: impl ops::RangeBounds<TextUnit>) -> SyntaxText<'a> { 69 pub fn slice(&self, range: impl ops::RangeBounds<TextUnit>) -> SyntaxText<'a> {
66 let start = match range.start_bound() { 70 let start = match range.start_bound() {