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 21:00:04 +00:00
committed by GitHub
parent 55d99e0259
commit 3c0d05e362
+1 -1
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);