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.
This commit is contained in:
Smit Barmase
2025-11-25 23:27:11 +05:30
committed by GitHub
parent 94f9b85859
commit 388fda2292
2 changed files with 117 additions and 8 deletions
+2 -1
View File
@@ -11,5 +11,6 @@ brackets = [
tab_size = 2
prettier_parser_name = "json"
debuggers = ["JavaScript"]
[overrides.string]
completion_query_characters = [":", " "]
completion_query_characters = [":", " ", "."]