# Use copilot's \`Completion::\{range,text\}\` to determine suggestion · gitcafe/zed

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

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

Visibility: public

Requested revision: 6e43e77c3f3eed3b7509152f54b3273a0997c331

Requested commit: 6e43e77c3f3eed3b7509152f54b3273a0997c331

Commit: 6e43e77c3f3eed3b7509152f54b3273a0997c331

Tree: 0904e45b17299ea301ec328d3fd8e4dd3db439e1

Author: Antonio Scandurra

Committer: Antonio Scandurra

## Message

```
Use copilot's `Completion::{range,text}` to determine suggestion

Previously, we were using display text, but this isn't always correct. Now,
we just attempt to determine what text Copilot wants to insert by finding
a prefix and suffix in the existing text with the suggested text.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>

```

## Parents

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

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