Skip to content

Commit

Permalink
Fix crash on lsp text edits with invalid ranges (#9649)
Browse files Browse the repository at this point in the history
  • Loading branch information
skyl4b committed Apr 6, 2024
1 parent 1ba5763 commit d3bfa3e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions helix-lsp/src/lib.rs
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 d3bfa3e

Please sign in to comment.