mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-28 11:29:25 +00:00
Ignore completions from gopls that we can't yet handle
We only support additionalEdits if they are provided when resolving the completion, not if they are provided immediately.
This commit is contained in:
parent
7bb7187619
commit
4ce4c0ef03
1 changed files with 10 additions and 0 deletions
|
@ -3054,6 +3054,16 @@ impl Project {
|
|||
Ok(completions
|
||||
.into_iter()
|
||||
.filter_map(|lsp_completion| {
|
||||
// For now, we can only handle additional edits if they are returned
|
||||
// when resolving the completion, not if they are present initially.
|
||||
if lsp_completion
|
||||
.additional_text_edits
|
||||
.as_ref()
|
||||
.map_or(false, |edits| !edits.is_empty())
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
||||
let (old_range, new_text) = match lsp_completion.text_edit.as_ref() {
|
||||
// If the language server provides a range to overwrite, then
|
||||
// check that the range is valid.
|
||||
|
|
Loading…
Reference in a new issue