lsp: Use replace edits for completions (#23490)

(Late) follow up to #9634.
Fixes #23395

Release Notes:

- Accepting completions while the cursor is in the middle of suggested
completion will now result in smaller edits being applied.
This commit is contained in:
Piotr Osiewicz 2025-01-22 22:00:04 +01:00 committed by GitHub
parent 55d99e0259
commit 3c0d05e362
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2123,7 +2123,7 @@ pub(crate) fn parse_completion_text_edit(
}
lsp::CompletionTextEdit::InsertAndReplace(edit) => {
let range = range_from_lsp(edit.insert);
let range = range_from_lsp(edit.replace);
let start = snapshot.clip_point_utf16(range.start, Bias::Left);
let end = snapshot.clip_point_utf16(range.end, Bias::Left);