Skip to content

fix: symfony/console $suggestedValues compatibility - #112

Open
nickvergessen wants to merge 3 commits into
stecman:masterfrom
nickvergessen:bugfix/noid/suggested-values-compatibility
Open

fix: symfony/console $suggestedValues compatibility#112
nickvergessen wants to merge 3 commits into
stecman:masterfrom
nickvergessen:bugfix/noid/suggested-values-compatibility

Conversation

@nickvergessen

@nickvergessen nickvergessen commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Assisted-by: ClaudeCode:claude-opus-5


Symfony added native support for autocomplete by now (in 5.4?): https://symfony.com/doc/current/console.html#console-completion-setup

The problem is that the mechanism works different and in order to be compatible with both mechanisms one has to implement both completions.

I currently see basically 2 options:

  1. Sunset this library and recommend to use symfony/console directly 🙈
  2. Add a compatibility to this library to detect the symfony completion defined on the addArgument() and addOption() calls and wire them to this library.

For anyone that is maintaining a single application, option 1 might even be the best, as it removes one more item in the maintenance chain.

For something that is a framework to a bigger ecosystem ( 👋 Hello from Nextcloud if you remember) option 2 would however be preferred as it would not break existing setups for administrators and neither breaks compatibility with old apps, while still allowing developers to be quite close to symfony/console when specifying/implementing commands (and not seeing a "suggestedValues" functionality on commands that doesn't do anything).

So I asked Claude with Opus5 to create a solution and it looks rather simple. A quick test against the nextcloud/server code base (using a branch that has the reference of CompletionAwareInterface removed nextcloud/server#63792 ) also showed that it's actually working.

To further assist with the transition CompletionAwareInterface could even be deprecated, but I didn't want to overcomplicate the starting point here.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Joas Schilling <coding@schilljs.com>
@stecman

stecman commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Hey @nickvergessen, if a compatibility shim is possible, I think doing both 1 & 2 is best. That would be a nice way to conclude this 13 year project without forcing Nextcloud to have a breaking API change. I regard API stability very highly, and have strived for it in this repo despite being technically pre-1.0 ...maybe the 1.0 should have been years ago!

If you can verify a patch that works for you, and make any changes needed for you to stand behind it (meets your personal standards, etc), I'm happy scrutinise, review and tie the ribbon on a release.

It's really neat to see Symfony finally includes this functionality. As I've become more and more distant from the PHP world over the last 10 years, it's somewhat of a relief to see in many ways.

…console way

Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen

Copy link
Copy Markdown
Contributor Author

if a compatibility shim is possible, I think doing both 1 & 2 is best.

Then let me add the deprecation note as well, so people see it when updating and start switching to the symfony/console way, as that works already in all supported symfony versions.

If you can verify a patch that works for you, and make any changes needed for you to stand behind it (meets your personal standards, etc)

I did that and as said, I patched a Nextcloud with it and it's working great.

I'm happy scrutinise, review and tie the ribbon on a release.

That would be much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants