Skip to content

Conversation

SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Sep 29, 2019

PR Summary

Add code to CompletionAnalysis class to detect if completion is for variable assignment and the variable is an enum. Then use helper GetResultForEnum() to return appropriate results matching string to complete. Enum strings are always quoted and will match initial single or double quote. Needed to have similar code in 3 places to handle:

$ErrorActionPreference = <tab>
$ErrorActionPreference = '<tab> # in this case, it's a string completion
$ErrorActionPreference=<tab>

Although it's not in this gif, the results are sorted by enum name alphabetically.

img

PR Context

Fix #10631

PR Checklist

@SteveL-MSFT
Copy link
Member Author

@PoshChan please retry windows

@PoshChan
Copy link
Collaborator

@SteveL-MSFT, successfully started retry of PowerShell-CI-Windows

@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Oct 5, 2019
@iSazonov iSazonov added this to the 7.0.0-preview.5 milestone Oct 5, 2019
Copy link
Collaborator

@rjmholt rjmholt left a comment

Choose a reason for hiding this comment

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

LGTM

@ghost ghost added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Oct 8, 2019
@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 10, 2019
@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Oct 10, 2019
@daxian-dbw daxian-dbw merged commit 0842fe8 into PowerShell:master Oct 14, 2019
@SteveL-MSFT SteveL-MSFT deleted the enum-completer branch October 14, 2019 16:55
@ghost
Copy link

ghost commented Oct 23, 2019

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

Handy links:

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.

Enable tab completion for variables that are of enum type

6 participants