# Fix logic for updating \`insert_range\` on completion resolution \(\#32523\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 7f44e4b89c74895165a986896d084779486f673c

Requested commit: 7f44e4b89c74895165a986896d084779486f673c

Commit: 7f44e4b89c74895165a986896d084779486f673c

Tree: 263d9cdb463cdc640fc28308d51061d3c4c0bdae

Author: Michael Sloan

Committer: GitHub

## Message

```
Fix logic for updating `insert_range` on completion resolution (#32523)

I don't have a concrete misbehavior from it, but this update of
`insert_range` doesn't make sense for two reasons:

* If the resolved completion doesn't have a new `text_edit` it would
clear out the `insert_range`.

* It doesn't update the completion if it has already been resolved,
except this update of `insert_range` happened before that.

Guessing it was written this way because this field needed to only be
mutated within the `CompletionSource::Lsp` case and this was a
convenient match below.

Release Notes:

- N/A

Co-authored-by: Smit <smit@zed.dev>
```

## Parents

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

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