feat: allow CLI users to disable completion auto-install - #134
Draft
unicoderbot[bot] wants to merge 1 commit into
Draft
feat: allow CLI users to disable completion auto-install#134unicoderbot[bot] wants to merge 1 commit into
unicoderbot[bot] wants to merge 1 commit into
Conversation
Closes #55 Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com>
2 tasks
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.
Warning
The coding agent reported this implementation is incomplete.
Code and tests are fully implemented, but analyze/tests could not be run because the provided Flutter SDK (Dart 3.12.2) is older than the repo's required ^3.13.0.
This PR has been opened as a draft. Review the diff against the original issue before marking it ready for review.
Summary
Adds the ability for CLI users (not just CLI maintainers) to opt out of the automatic installation of completion files.
What changed
disable-completion-auto-install(DisableCompletionInstallationCommand), added toCompletionCommandRunneronly whenenableAutoInstallis enabled. It is also registered as a reserved command so running it does not itself trigger an auto install.CompletionConfigurationgains anenabledflag that is serialized to/fromconfig.json(enabledJSON key). It defaults totruewhen missing or of an invalid type, so existing configurations keep working.CompletionInstallationexposesisAutoInstallEnabledandsetAutoInstallEnabled({required bool enabled})to read/write the persisted preference, and_shouldInstallnow short-circuits when the user has disabled auto installation.install-completion-fileswritesenabled: trueagain, since installing implies the user wants completion.copyWith, and the installation enable/disable logic (plus some formatting cleanups in existing tests).Closes #55