-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Fix tab completion for parameters so that it shows common parameters as available #10850
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
Fix tab completion for parameters so that it shows common parameters as available #10850
Conversation
src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs
Outdated
Show resolved
Hide resolved
I guess that initial design was to hide common parameters because in cmdlets with many parameters they can annoy. If I remember right there was a suggestion to show common parameters with<Ctrl-Tab> but hide with <Tab>. |
Ok, found an unintended side effect that makes this a breaking change. With the filtering, you could do: |
reformat Get-Member tests as it had embedded tabs
With the new update and simpler fix, this is not a breaking change :) |
test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Member.Tests.ps1
Outdated
Show resolved
Hide resolved
…r.Tests.ps1 Co-Authored-By: Ilya <darpa@yandex.ru>
@PoshChan please retry static |
@SteveL-MSFT, successfully started retry of |
@PoshChan please retry windows |
@SteveL-MSFT, successfully started retry of |
@PoshChan please retry static |
@SteveL-MSFT, successfully started retry of |
🎉 Handy links: |
PR Summary
The current code deliberately filtered out common parameters and preferring specific parameters. This resulted in tab completion where you only got results if the text matched a cmdlet parameter even though it would also match a common parameter. Fix is to use the filtering code only if it's not a tab complete situation. The
tryExactMatching
is only used when the cmdlet is being executed and not when tab complete is being used so we can use that to only exercise the filtering code.PR Context
Fix #1265
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.