Repository navigation
[Server] Fix "0" prefix offering all completions - #655
Merged
chr-hertel merged 1 commit intoNov 2, 2026
Merged
Conversation
`empty("0")` is true, so `EnumCompletionProvider` and `ListCompletionProvider`
returned every value for that prefix.
chr-hertel
requested review from
CodeWithKyrian,
Nyholm and
soyuka
as code owners
November 2, 2026 21:53
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the fix that treats "0" as a literal completion prefix.
No open issues 🎉
What changed in this PR
Fixes server-side enum and list completion filtering so "0" is treated as a literal prefix. Only an empty string returns all available values.
Changes:
- Replace
empty()checks with strict empty-string comparisons in both providers. - Add regression tests for
"0"and update enum coverage to preserve empty-prefix behavior. - Document the fix in the changelog.
| File | Description |
|---|---|
tests/Unit/Capability/Completion/ListCompletionProviderTest.php |
Verify "0" returns only matching list values. |
tests/Unit/Capability/Completion/EnumCompletionProviderTest.php |
Verify zero-prefix filtering and empty-prefix behavior. |
src/Capability/Completion/ListCompletionProvider.php |
Restrict unfiltered results to an empty prefix. |
src/Capability/Completion/EnumCompletionProvider.php |
Restrict unfiltered results to an empty prefix. |
CHANGELOG.md |
Record the completion-filtering fix. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
empty("0")is true, soEnumCompletionProviderandListCompletionProviderreturned every value for the prefix0instead of only the ones starting with it. Now only an empty prefix offers everything.Spotted while reviewing #652, which pinned the behavior in a test - replaced here. #649 adds the same test for the list provider and needs an update after this.