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
Improve hashtable key completion for type constrained variable assignments, nested hashtables and more #17660
Improve hashtable key completion for type constrained variable assignments, nested hashtables and more #17660
Conversation
… and command parameters
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs
Show resolved
Hide resolved
…e that hasn't been loaded yet. Fix tab completion for constructor hashtables so it only completes properties if the class has a null constructor. Fix tab completion for constructor hashtables that use a PowerShell type that hasn't been loaded yet. Fix tab completion for nested hashtables like Get-WinEvent -FilterHashtable @{SuppressHashFilter=@{<Tab> Fix tab completion for hashtables that are in an array of arguments like: ls | select Name,@{<Tab>} Add the same property completion that exists for type conversions to typed variables command parameters and Property assignments
Fix class name as requested by iSazonov Add enumeration for the inferred types
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
@SeeminglyScience Please review. |
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
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.
Sorry for taking so long to review. Not finished yet, but want to share feedback so far.
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs
Show resolved
Hide resolved
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.
I'm fine the use of goto LABEL
here to break out of the loop. It's not that confusing to get what it does by reading the code.
@MartinGC94 Thanks for the contribution and I appreciate your patience. |
This is awesome work! |
🎉 Handy links: |
PR Summary
Fixes PowerShell/PowerShellEditorServices#1852
Decided to make a full fix for all hashtable key completion scenarios I could think of:
Get-WinEvent -FilterHashtable @{SuppressHashFilter=@{<Tab>
ls | select Name,@{<Tab>}
using module @{<Tab>
PR Context
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.(which runs in a different PS Host).