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 postsolar committed Apr 20, 2024
1 parent 6f4b894 commit b9dc64e
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 b9dc64e

Please sign in to comment.