# editor: Utilize \`filter_text\` from language server for \`filter_range\` \(\#33155\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 76e3136369484841cba934eb8669570e24d597fb

Requested commit: 76e3136369484841cba934eb8669570e24d597fb

Commit: 76e3136369484841cba934eb8669570e24d597fb

Tree: 2f82493e47cbf296c1445a40592dc56361c4f00c

Author: Smit Barmase

Committer: GitHub

## Message

```
editor: Utilize `filter_text` from language server for `filter_range` (#33155)

Closes #33106

Instead of directly using `filter_text` in `StringMatchCandidate`, which
yields better results for fuzzy matching but messes up with highlighting
letters in bold, as `positions` list generated by fuzzy crate are now of
`filter_text` and not `label` shown to the user.

This PR fixes it by keeping use of `filter_range` in
`StringMatchCandidate`, which is range w.r.t to `label` shown to user.
And actually generating this `filter_range` at source by using
`filter_range` if exists.

- [x] Tests

Release Notes:

- Fixed issue where incorrect letters are marked as bold in completions.
```

## Parents

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

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