# editor: Improve code completions by prioritizing prefix matching \(\#29456\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f2b4004c0043d74b398cf5a38d3f59e5ce9aac61

Requested commit: f2b4004c0043d74b398cf5a38d3f59e5ce9aac61

Commit: f2b4004c0043d74b398cf5a38d3f59e5ce9aac61

Tree: 36b54c87a53a80760b98aa4e1f76ffcddcc1b6c6

Author: Smit Barmase

Committer: GitHub

## Message

```
editor: Improve code completions by prioritizing prefix matching (#29456)

- Use common prefix length-based matching as primary criteria.
- Test added for multiple cases.

Before:
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/8c653225-cac2-41bd-95f0-0fb8724284c9"
/>

After:
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/a3d59399-cff2-435d-9b56-69a530f35da4"
/>

Release Notes:

- Fixed issues with code completions where they wouldn't show
completions with matched prefix at top.
```

## Parents

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

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