Skip to content

Commit 392d333

Browse files
committed
Remove panic from to_notebook_range
1 parent 4ab4eb7 commit 392d333

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

crates/ruff_server/src/edit/range.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,6 @@ impl ToRangeExt for TextRange {
126126
// weird edge case here - if the end of the range is where the newline after the cell got added (making it 'out of bounds')
127127
// we need to move it one character back (which should place it at the end of the last line).
128128
match (cell, notebook_index.cell(end.row)) {
129-
// If the start and end of the range are in two different cells, this is a logic error.
130-
// We should never generate text ranges that cross over cells.
131-
(Some(start_cell), Some(end_cell)) if start_cell != end_cell => {
132-
panic!("attempted to create notebook range that crosses cell boundaries")
133-
}
134129
// If the ending offset is not within a cell boundary, this usually means it is in between the cell boundaries -
135130
// in other words, it's pointing to the newline between the cells.
136131
// By subtracting the end position by 1, we get it to point to the end of the cell.

0 commit comments

Comments
 (0)