Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add support for autocompleting setting-keys in config-command #11130

Conversation

brandung-sjorek
Copy link
Contributor

@brandung-sjorek brandung-sjorek commented Oct 16, 2022

This PR implements the support for autocompletion of setting-keys in the config-command and its related functional tests. The implementation takes existing command-line options like --unset or --global into account, as well as existing exposable package-properties. The result is a context-sensitive auto-completion with individual lists of setting-keys.

Additionally showing the value of suggest. sub-keys has been allowed in the config-command, as setting and unsetting them has always been possible, and I did not want to distinguish between showing, setting and unsetting those keys.

In the setting-key flattening-method I used the array_is_list() function, which was added in PHP 8.1 recently. For backwards PHP-compatibility the package symfony/polyfill-php81 has been added and the corresponding test-fixtures have been fixed accordingly.

Fixes: #11131
Signed-off-by: Stephan Jorek stephan.jorek@brandung.de

This PR implements the support for autocompletion of setting-keys in the
config-command and its related funtional tests. The implementation takes
existing command-line options like `--unset` or `--global` into account, as
well as existing exposable package-properties. The result is a context-
sensitive auto-completion of individual lists of setting-keys.

Additionally showing the value `suggest.` sub-keys has been allowed in
the config-command, as setting and unsetting them has alwas been possible,
and I did not want to distinguish between showing, setting and unsetting
those keys.

In the setting-key flattening-method I used the `array_is_list()` function,
which was added in PHP 8.1 recently. For backwards PHP-compatiblity the
package `symfony/polyfill-php81` has been added.

Signed-off-by: Stephan Jorek <stephan.jorek@brandung.de>
@private-packagist
Copy link

composer.lock

Package changes

Package Operation From To Changes
symfony/polyfill-php81 add - v1.26.0 view code

Settings · Docs · Powered by Private Packagist

@Seldaek
Copy link
Member

Seldaek commented Oct 25, 2022

Thanks, looking good!

@brandung-sjorek
Copy link
Contributor Author

Thanks, looking good!

Thank you!

emahorvat52 pushed a commit to emahorvat52/composer that referenced this pull request Feb 3, 2023
composer#11130)

* Add support for autocompleting setting-keys in config-command

This PR implements the support for autocompletion of setting-keys in the
config-command and its related funtional tests. The implementation takes
existing command-line options like `--unset` or `--global` into account, as
well as existing exposable package-properties. The result is a context-
sensitive auto-completion of individual lists of setting-keys.

Additionally showing the value `suggest.` sub-keys has been allowed in
the config-command, as setting and unsetting them has alwas been possible,
and I did not want to distinguish between showing, setting and unsetting
those keys.

In the setting-key flattening-method I used the `array_is_list()` function,
which was added in PHP 8.1 recently. For backwards PHP-compatiblity the
package `symfony/polyfill-php81` has been added.

Signed-off-by: Stephan Jorek <stephan.jorek@brandung.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Add support for autocompleting setting-keys in config-command
2 participants