diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index c58d967b66fc..f1ffcdf88b9b 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -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) }), )