lsp: Support insertReplace

Fixes #4473
pull/4651/head
Blaž Hrastnik 2 years ago
parent 188aff059b
commit 13126823f8
No known key found for this signature in database
GPG Key ID: 1238B9C4AD889640

@ -311,6 +311,7 @@ impl Client {
String::from("additionalTextEdits"),
],
}),
insert_replace_support: Some(true),
..Default::default()
}),
completion_item_kind: Some(lsp::CompletionItemKindCapability {

@ -113,7 +113,8 @@ impl Completion {
let edit = match edit {
lsp::CompletionTextEdit::Edit(edit) => edit.clone(),
lsp::CompletionTextEdit::InsertAndReplace(item) => {
unimplemented!("completion: insert_and_replace {:?}", item)
// TODO: support using "insert" instead of "replace" via user config
lsp::TextEdit::new(item.replace, item.new_text.clone())
}
};

Loading…
Cancel
Save