-
Notifications
You must be signed in to change notification settings - Fork 5
🚀[Feature]: Add a config for how to match argument completers #512
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
Conversation
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
…mpletion Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
@copilot |
…rties Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
I've enhanced the ✅ Adds new properties - Any new config values (like When users upgrade to this version, their local config will automatically get the new Implemented in commit d058ea4. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This patch adds a new CompletionMode
configuration option to control argument completion behavior (StartsWith vs Contains matching) and enhances the configuration system to automatically synchronize local configs when the module is upgraded.
- Added
CompletionMode
property toGitHubConfig
class withStartsWith
(default) andContains
options - Created
Get-GitHubCompletionPattern
helper function and updated all 30 argument completer instances to use it - Enhanced configuration synchronization to automatically add new properties and remove obsolete ones during module upgrades
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/classes/public/Config/GitHubConfig.ps1 | Added CompletionMode property to the GitHubConfig class |
src/variables/private/GitHub.ps1 | Added default CompletionMode value to module configuration |
src/functions/private/Config/Get-GitHubCompletionPattern.ps1 | New helper function to generate completion patterns based on configuration |
src/functions/private/Config/Initialize-GitHubConfig.ps1 | Enhanced config synchronization logic for automatic property management |
src/functions/public/Config/completers.ps1 | Updated to use new pattern helper and added completion for CompletionMode values |
Multiple completer files (13 files) | Updated all argument completers to use the new pattern generation helper |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…itHubConfig function
Module GitHub - 0.37.0 published to the PowerShell Gallery. |
GitHub release for GitHub v0.37.0 has been created. |
This pull request introduces a new configurable completion mode for argument completers, allowing users to choose between 'StartsWith' and 'Contains' matching for tab completion throughout the module. It also improves the config initialization logic to better synchronize stored configuration objects with the current class definition, ensuring obsolete properties are removed and new ones are added automatically.
Configurable Completion Mode:
CompletionMode
property to theGitHubConfig
class, allowing users to select between 'StartsWith' and 'Contains' matching for argument completion. This property is now included in the config display format.CompletionMode
from config, switching between prefix and substring matching as specified. This affects completers for contexts, organizations, environments, gitignore, licenses, permissions, and repository permissions.CompletionMode
property itself, suggesting 'StartsWith' and 'Contains' when setting the config.Configuration Management Improvements:
Initialize-GitHubConfig
function to automatically add new properties and remove obsolete ones from stored configs, ensuring the config object stays in sync with the class definition.Minor Usability Improvement:
Context
parameter inGet-GitHubContext
positional for easier use.