Skip to content

Commit

Permalink
Fix crash on lsp text edits with invalid ranges (helix-editor#9649)
Browse files Browse the repository at this point in the history
  • Loading branch information
skyl4b authored and Vulpesx committed Jun 7, 2024
1 parent 9c8887e commit e83d8a5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions helix-lsp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,16 @@ pub mod util {
} else {
return (0, 0, None);
};

if start > end {
log::error!(
"Invalid LSP text edit start {:?} > end {:?}, discarding",
start,
end
);
return (0, 0, None);
}

(start, end, replacement)
}),
)
Expand Down

0 comments on commit e83d8a5

Please sign in to comment.