Fix crash on lsp text edits with invalid ranges (#9649)
This commit is contained in:
parent
1ba5763a0c
commit
d3bfa3e063
1 changed files with 10 additions and 0 deletions
|
@ -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)
|
||||
}),
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue