# project: Fix LSP completion to use \`insertText\` when constructing default edits \(\#27630\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 84dd2366bc190cd278ed7d0bc60b1bbd8f98611c

Requested commit: 84dd2366bc190cd278ed7d0bc60b1bbd8f98611c

Commit: 84dd2366bc190cd278ed7d0bc60b1bbd8f98611c

Tree: 90ed9e629c90e7247ddcde089a9f0dc3cf26f4fb

Author: Smit Barmase

Committer: GitHub

## Message

```
project: Fix LSP completion to use `insertText` when constructing default edits (#27630)

Closes #25761 #21603

When `text_edit` is not available we directly fallback to to `label`.
That means, when we have range to replace, we never use `insertText` and
only use it when we haven't found any range.

This PR fixes, this and uses `insertText` as fallback first, and then
`label`.

Release Notes:

- Fixed an issue where accepting LSP snippet completion would insert the
label instead of expanding the snippet.
```

## Parents

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

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