[Capability] Remove CompletionProvider's dead providerClass argument - #499
Merged
Conversation
chr-hertel
requested review from
CodeWithKyrian,
Nyholm and
soyuka
as code owners
September 5, 2026 00:50
It always threw on construction, so it never worked in any release. `provider:` takes the same class-string and is now the first positional argument.
chr-hertel
force-pushed
the
fix-completion-provider-class
branch
from
September 7, 2026 20:38
9d1136c to
3c8c7bb
Compare
chr-hertel
commented
Sep 7, 2026
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.
#[CompletionProvider(providerClass: Foo::class)]has never worked in any release. The constructor's exactly-one-source check wasarray_filter([$provider, $values, $enum])—$providerClasswas never counted, so the form always threwOnly one of provider, values, or enum can be set.duringnewInstance(). Discovery catches that and drops the element, so the whole prompt/template silently disappeared.Discoverer::getCompletionProviders()then stored$attributeInstance->providerin theproviderClassbranch, alwaysnullthere.So rather than making it work:
provider:already accepts aclass-string<ProviderInterface>and resolves it through the container identically, which makesproviderClassa redundant spelling that nothing can depend on — every version that shipped it threw on construction. Removing it also unlocks the positional form#[CompletionProvider(Foo::class)], which until now hitproviderClassand threw.[BC Break] in the changelog, though the practical risk is nil: no working code could have set the property.
Covered from both ends.
DiscoveryTestpins the positional class-string surviving discovery unresolved, and a new integration test drives a real client against a real server over stdio — the fixture's provider takes a scalar the auto-wiring container cannot supply, so it can only come fromContainer::set(), and completions arriving at all prove the container was asked to build it.Found by Copilot's review on #492.