-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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 member completion #16504
Improve member completion #16504
Conversation
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/CompletionAnalysis.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.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
Co-authored-by: Ilya <darpa@yandex.ru>
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs
Show resolved
Hide resolved
Co-authored-by: Ilya <darpa@yandex.ru>
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.
Formally LGTM but I don't understand why we need cases like '[System.Management.Automation.ActionPreference]::Break. ^'
. It's up to other reviewers.
For me it's just for the sake of consistency. If the parser allows it then I don't see why the completion code shouldn't support it either. |
@TravisEz13 Can you 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. |
@daxian-dbw Can you 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. |
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs
Show resolved
Hide resolved
src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.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
Outdated
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
Outdated
Show resolved
Hide resolved
Co-authored-by: Dongbo Wang <dongbow@microsoft.com>
Co-authored-by: Dongbo Wang <dongbow@microsoft.com>
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) |
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.
LGTM. Thanks @MartinGC94!
🎉 Handy links: |
PR Summary
Fixes #10529
The member completion code wrongly assumed that the parent to the error statement was what should be completed, instead of traversing up to where the cursor actually was. Now you should get accurate member completion regardless of where the cursor is.
This also adds member completion for switch statements like:
Allows completion of members/attribute arguments regardless of surrounding spaces/new lines (If the parser would allow it in that context).
Adds a test for a seemingly untested scenario:
ls "".<Tab>
And filters out attribute arguments that have already been used in the attribute, for example:
will not show Position again.
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).