Skip to content
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

Enable experimental feature to support tab completion on abbreviated cmdlets #8109

Merged
merged 7 commits into from Jan 11, 2019

Conversation

SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Oct 23, 2018

PR Summary

While watching some demos at PSConfAsia, it's obvious that cmdlet nouns have gotten descriptive and wordy (Azure and AWS are good examples). This experimental feature enables tab-completion of abbreviated cmdlets and functions:

i-psdf<tab>

returns: Import-PowerShellDataFile

u-akvmssdr<tab>

returns: Undo-AzKeyVaultManagedStorageSasDefinitionRemoval

Note that this only works for tab completion (interactive use), so i-psdf is still an invalid cmdlet name in scripts.

The matching is entirely based on the capital letters of the verb and noun. To test this, create test.json:

{
  "ExperimentalFeatures": [
    "PSUseAbbreviationExpansion"
  ]
}

And run:

pwsh -settingsfile ./test.json

Associated RFC

PR Checklist

@anmenaga
Copy link
Contributor

anmenaga commented Nov 8, 2018

This needs another [feature] test pass to make sure it is green.

@anmenaga
Copy link
Contributor

@daxian-dbw @BrucePay This PR needs your review.

@stale
Copy link

stale bot commented Dec 28, 2018

This PR has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs within 10 days.
Thank you for your contributions.
Community members are welcome to grab these works.

Copy link
Member

@JamesWTruher JamesWTruher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's nothing in my comments which are blocking, but I am worried about the case where we have an error (CompletionCompleters, line 193)

@daxian-dbw
Copy link
Member

daxian-dbw commented Jan 10, 2019

@SteveL-MSFT There is one comment pending #8109 (comment), can you please respond to it?

enable experimental feature to support tab completion on abbreviations of cmdlets
address codefactor issues
fixed code to support returning multiple results and not just first one
added test for automoduleloading which also covers multiple results from different modules
address Dongbo's feedback
Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@daxian-dbw daxian-dbw merged commit 71e58f9 into PowerShell:master Jan 11, 2019
@SteveL-MSFT SteveL-MSFT deleted the get-command-abbr branch January 11, 2019 01:51
@iSazonov
Copy link
Collaborator

@daxian-dbw Do we add experimental features to Change log? Do we need set CL-* label?

@PaulHigin PaulHigin added the CL-Engine Indicates that a PR should be marked as an engine change in the Change Log label Jan 24, 2019
TravisEz13 pushed a commit that referenced this pull request Apr 18, 2019
Re-add wildcard when searching AST + Missed test case.

## PR Context

In #8109, we removed the line that added a wildcard to the end of the command that was used to match commands in the script AST. This readds that line closer to where it is used.
TravisEz13 pushed a commit that referenced this pull request May 13, 2019
Re-add wildcard when searching AST + Missed test case.

## PR Context

In #8109, we removed the line that added a wildcard to the end of the command that was used to match commands in the script AST. This readds that line closer to where it is used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CL-Engine Indicates that a PR should be marked as an engine change in the Change Log Experimental Experimental Feature WG-Engine core PowerShell engine, interpreter, and runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants