# Allow all completions with preresolved additional text edits \(\#2711\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/d1640341989ee76a19c9e24151eae3a6c26d6c97)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: d1640341989ee76a19c9e24151eae3a6c26d6c97

Requested commit: d1640341989ee76a19c9e24151eae3a6c26d6c97

Commit: d1640341989ee76a19c9e24151eae3a6c26d6c97

Tree: 3c131b791b54b1933a50e23245da4a6039d42a82

Author: Kirill Bulatov

Committer: GitHub

## Message

```
Allow all completions with preresolved additional text edits (#2711)

Deals with https://github.com/zed-industries/community/issues/752
Deals with https://github.com/zed-industries/community/issues/566

Currently, when converting from LSP to Zed objects, completions with
non-empty `additional_text_edits` are filtered out.
Later, all other completions form a list and the selected one gets the
`Editor::confirm_completion` call, which always queries an LSP
completion resolve request to get the `additional_text_edits` field.

Otherwise, `additional_text_edits` field is ignored entirely for the
rest of the completion lifetime — and we always pass the selected
completion through the resolve request.

The PR changes the logic, removing the `additional_text_edits` filtering
and instead of resolving every completion, now we check for
`additional_text_edits` in the completion before resolving: resolve
happens only if the data is absent.

Generally, feels like resolve has to happen before the completion
selection: LSP servers may send us markdown for completion documentation
preview pop ups and similar extra info.
Also, the server may lack resolve capabilities entirely, always sending
the request seems dangerous.
For now, the PR does not attempt to change either.

Release Notes:

- Brings rust-analyzer's postfix completions and others completions with
preresolved additional text edits
```

## Parents

- [ad4f5e55cb9936f9b2cd74010cb772a21e1e36cd](https://git.cafe/gitcafe/zed/commit/ad4f5e55cb9936f9b2cd74010cb772a21e1e36cd?format=markdown)

- [0c7949bdeec2fa2ec48a9cf65f9f6cee74e85c57](https://git.cafe/gitcafe/zed/commit/0c7949bdeec2fa2ec48a9cf65f9f6cee74e85c57?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/d1640341989ee76a19c9e24151eae3a6c26d6c97?format=markdown)
