Start work on interpreting 'label/insertText' completions
These completions don't supply a range that should be overwritten, so the client needs to infer it via substring matching. Co-authored-by: Keith Simmons <keith@zed.dev>
This commit is contained in:
parent
c280c85ce7
commit
263e3d8176
3 changed files with 20 additions and 1 deletions
|
@ -2363,7 +2363,10 @@ impl Project {
|
|||
Some(lsp::CompletionTextEdit::Edit(edit)) => {
|
||||
(range_from_lsp(edit.range), edit.new_text.clone())
|
||||
}
|
||||
None => (position..position, lsp_completion.label.clone()),
|
||||
None => (
|
||||
this.common_prefix_at_position(position, &lsp_completion.label),
|
||||
lsp_completion.label.clone(),
|
||||
),
|
||||
Some(lsp::CompletionTextEdit::InsertAndReplace(_)) => {
|
||||
log::info!("unsupported insert/replace completion");
|
||||
return None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue