···11-use std::collections::HashMap;
22-11+use crate::ast::SrcSpan;
32use lsp_types::Position;
33+use std::collections::HashMap;
4455/// A struct which contains information about line numbers of a source file,
66/// and can convert between byte offsets that are used in the compiler and
···135135 }
136136137137 u8_offset
138138+ }
139139+140140+ /// Checks if the given span spans an entire line (excluding the newline
141141+ /// character itself).
142142+ pub fn spans_entire_line(&self, span: &SrcSpan) -> bool {
143143+ self.line_starts.iter().any(|&line_start| {
144144+ line_start == span.start && self.line_starts.contains(&(span.end + 1))
145145+ })
138146 }
139147}
140148