Skip to content

Commit

Permalink
lsp: Support insertReplace
Browse files Browse the repository at this point in the history
Fixes #4473
  • Loading branch information
archseer committed Nov 8, 2022
1 parent 188aff0 commit 1312682
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions helix-lsp/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ impl Client {
String::from("additionalTextEdits"),
],
}),
insert_replace_support: Some(true),
..Default::default()
}),
completion_item_kind: Some(lsp::CompletionItemKindCapability {
Expand Down
3 changes: 2 additions & 1 deletion helix-term/src/ui/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
};

Expand Down

0 comments on commit 1312682

Please sign in to comment.