mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-01 14:15:11 +00:00
Respect lsp completions' 'insert_text' property when present
Fixes #839
This commit is contained in:
parent
c61ae6f31f
commit
8ddc7e6458
1 changed files with 6 additions and 7 deletions
|
@ -2502,13 +2502,12 @@ impl Project {
|
||||||
log::info!("completion out of expected range");
|
log::info!("completion out of expected range");
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
(
|
let text = lsp_completion
|
||||||
this.common_prefix_at(
|
.insert_text
|
||||||
clipped_position,
|
.as_ref()
|
||||||
&lsp_completion.label,
|
.unwrap_or(&lsp_completion.label)
|
||||||
),
|
.clone();
|
||||||
lsp_completion.label.clone(),
|
(this.common_prefix_at(clipped_position, &text), text.clone())
|
||||||
)
|
|
||||||
}
|
}
|
||||||
Some(lsp::CompletionTextEdit::InsertAndReplace(_)) => {
|
Some(lsp::CompletionTextEdit::InsertAndReplace(_)) => {
|
||||||
log::info!("unsupported insert/replace completion");
|
log::info!("unsupported insert/replace completion");
|
||||||
|
|
Loading…
Reference in a new issue