FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix tab completion for parameters so that it shows common parameters as available by SteveL-MSFT · Pull Request #10850 · PowerShell/PowerShell · GitHub

Fix tab completion for parameters so that it shows common parameters as available - #10850

Merged
Dongbo Wang (daxian-dbw) merged 5 commits into
PowerShell:masterfrom
SteveL-MSFT:tabcomplete-commonparams
Oct 31, 2019
Merged

Fix tab completion for parameters so that it shows common parameters as available#10850
Dongbo Wang (daxian-dbw) merged 5 commits into
PowerShell:masterfrom
SteveL-MSFT:tabcomplete-commonparams

Conversation

Steve Lee (SteveL-MSFT) commented Oct 20, 2019
edited
Loading

Copy link
Copy Markdown
Member

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

Ilya (iSazonov) commented Oct 20, 2019
edited
Loading

Copy link
Copy Markdown
Collaborator

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>.

Steve Lee (SteveL-MSFT) changed the title BUG: Remove code that filtered out common params so they show up with… Remove code that filtered out common params so they show up with… Oct 21, 2019
Steve Lee (SteveL-MSFT) changed the title Remove code that filtered out common params so they show up with… WIP: Remove code that filtered out common params so they show up with… Oct 21, 2019

Copy link
Copy Markdown
Member Author

Ok, found an unintended side effect that makes this a breaking change. With the filtering, you could do: gm -i $a as it prefers cmdlet params to common params. With this change, gm -i $a throws that the parameter is ambiguous as it could be -informationaction or -informationvariable. Will need some additional code to handle this case.

reformat Get-Member tests as it had embedded tabs
Steve Lee (SteveL-MSFT) changed the title WIP: Remove code that filtered out common params so they show up with… Remove code that filtered out common params so they show up with… Oct 21, 2019

Copy link
Copy Markdown
Member Author

With the new update and simpler fix, this is not a breaking change :)

Steve Lee (SteveL-MSFT) changed the title Remove code that filtered out common params so they show up with… Fix code so that tab completion for parameters shows common parameters as available Oct 22, 2019
…r.Tests.ps1

Co-Authored-By: Ilya <darpa@yandex.ru>
Steve Lee (SteveL-MSFT) changed the title Fix code so that tab completion for parameters shows common parameters as available Fix tab completion for parameters so that it shows common parameters as available Oct 22, 2019

Copy link
Copy Markdown
Member Author

PoshChan-Bot (@PoshChan) please retry static

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT), successfully started retry of PowerShell-CI-static-analysis

Copy link
Copy Markdown
Member Author

PoshChan-Bot (@PoshChan) please retry windows

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT), successfully started retry of PowerShell-CI-Windows

Copy link
Copy Markdown
Member Author

PoshChan-Bot (@PoshChan) please retry static

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT), successfully started retry of PowerShell-CI-static-analysis

Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Oct 31, 2019
Ilya (iSazonov) added this to the 7.0.0-preview.6 milestone Oct 31, 2019
Dongbo Wang (daxian-dbw) merged commit df81192 into PowerShell:master Oct 31, 2019

Copy link
Copy Markdown

🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada:

Handy links:

Steve Lee (SteveL-MSFT) deleted the tabcomplete-commonparams branch June 6, 2020 02:31
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
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

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tab completion confusion with common parameters

5 participants


Back | FazBrowse Home | New Git URL