-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add commands for controlling completion options #19518
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
base: master
Are you sure you want to change the base?
Conversation
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment. |
|
I am NOT an expert in the code - but I did look! For my benefit where are these completion options to be stored? Are they persisted? Also - what is the status on this? |
In the execution context (same place that argument completers are stored) so no, it's not persistent.
I was waiting on the path completion improvements PR to get merged (which happened earlier this week) as well as the ExcludeModule parameter PR: #18955 |
|
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) |
|
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment. |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
PR Summary
Adds the commands:
which allows the user to view and change various code completion related settings.
Currently there are 4 options available:
1: AddTrailingSeparatorForContainers (bool) which determines whether or not a separator should be added at the end of directory completions, like:
gci C:\Windo<Tab> -> C:\Windows\2: PreferredPathSeparator (Enum) which determines how to handle separators when completing file paths. There are 4 possible values:
3: PathSorting (Enum) which determines how path completion results are sorted. Default behavior is to sort by the full path but this can be turned off, or changed to list containers first.
4: ExcludedModules (string array) which allows users to exclude commands from certain modules from the completion results.
PR Context
Fixes #18963
As mentioned in that issue there are various user requests to change code completion behavior and some of those requests may not be suited for everyone.
We already have the "Options" hashtable in
Tabexpansion2but it's not very user friendly to edit that function to change completion options you may want to change on the fly.A point worth discussing would be if we should include the existing completion options (Include hidden fileshares, relative/full paths and literal VS normal paths).
I decided to take inspiration from
Register-ArgumentCompleterand make these options into commands, rather than a PS variable but either option is fine by me.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).