We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5696e38 commit 1bb85bdCopy full SHA for 1bb85bd
src/parse/session.rs
@@ -218,6 +218,15 @@ impl ParseSess {
218
self.parse_sess.source_map().lookup_char_pos(pos).line
219
}
220
221
+ // TODO(calebcartwright): Preemptive, currently unused addition
222
+ // that will be used to support formatting scenarios that take original
223
+ // positions into account
224
+ /// Determines whether two byte positions are in the same source line.
225
+ #[allow(dead_code)]
226
+ pub(crate) fn byte_pos_same_line(&self, a: BytePos, b: BytePos) -> bool {
227
+ self.line_of_byte_pos(a) == self.line_of_byte_pos(b)
228
+ }
229
+
230
pub(crate) fn span_to_debug_info(&self, span: Span) -> String {
231
self.parse_sess.source_map().span_to_diagnostic_string(span)
232
0 commit comments