# editor: Fix package version completion partial accept and improve sorting \(\#43473\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 388fda2292ccbe381c18473030461420f06c36cd

Requested commit: 388fda2292ccbe381c18473030461420f06c36cd

Commit: 388fda2292ccbe381c18473030461420f06c36cd

Tree: 4664acf6097c98da9f11e080a6e825537c81bbd5

Author: Smit Barmase

Committer: GitHub

## Message

```
editor: Fix package version completion partial accept and improve sorting (#43473)

Closes #41723

This PR fixes an issue with accepting partial semver completions by
including `.` in the completion query. This makes the editor treat the
entire version string as the query, instead of breaking segment at last
`.` .

This PR also adds a test for sorting semver completions. The actual
sorting fix is handled in the `package-version-server` by having it
provide `sort_text`. More:
https://github.com/zed-industries/package-version-server/pull/10

<img width="600" alt="image"
src="https://github.com/user-attachments/assets/7657912f-c6da-4e05-956b-1c044918304f"
/>

Release Notes:

- Fixed an issue where accepting a completion for a semver version in
package.json would append the suggestion to the existing text instead of
replacing it.
- Improved the sorting of semver completions in package.json so the
latest versions appear at the top.
```

## Parents

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

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