-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Add ArgumentCompleter to Configuration parameter in BuildModules.ps1 #28835
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
base: main
Are you sure you want to change the base?
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
Co-authored-by: isra-fel <11371776+isra-fel@users.noreply.github.com>
|
Please make it an argument completer instead of validateset because there might be more options. @copilot |
Co-authored-by: isra-fel <11371776+isra-fel@users.noreply.github.com>
Changed to ArgumentCompleter in commit c387de4. This provides tab completion for "Debug" and "Release" while allowing future expansion of configuration options without requiring code changes to the validation logic. |
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 PR adds tab completion support for the Configuration parameter in the BuildModules.ps1 script to improve developer experience when building modules.
- Adds an
ArgumentCompleterattribute to theConfigurationparameter - Provides autocomplete suggestions for 'Debug' and 'Release' configuration values
| [string]$RepoRoot, | ||
| [ArgumentCompleter({ | ||
| param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) | ||
| @('Debug', 'Release') | Where-Object { $_ -like "$wordToComplete*" } |
Copilot
AI
Nov 10, 2025
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.
The -like operator is case-sensitive in PowerShell. This means tab completion won't work if a user types lowercase text like "deb" or "rel". Consider using the case-insensitive -ilike operator instead to provide a better user experience:
@('Debug', 'Release') | Where-Object { $_ -ilike "$wordToComplete*" }| @('Debug', 'Release') | Where-Object { $_ -like "$wordToComplete*" } | |
| @('Debug', 'Release') | Where-Object { $_ -ilike "$wordToComplete*" } |
Description
Added
[ArgumentCompleter]attribute to the$Configurationparameter intools/BuildScripts/BuildModules.ps1to enable tab completion for configuration options.Changes:
[ArgumentCompleter]with script block to provide tab completion for "Debug" and "Release" valuesImpact:
-Configuration <TAB>shows Debug/Release optionsImplementation:
Key Difference from ValidateSet:
Example:
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.