Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
MartinGC94 wants to merge5 commits intoPowerShell:master
base:master
Choose a base branch
Loading
fromMartinGC94:AddCompletionOptions

Conversation

MartinGC94
Copy link
Contributor

@MartinGC94MartinGC94 commentedApr 15, 2023
edited
Loading

PR Summary

Adds the commands:

  • Get-CompletionOptions
  • Set-CompletionOptions

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:

  1. Default - Current behavior where it uses the separator specified in the provider.
  2. LastUsed - Uses whichever separator was last seen in the input text, or if no separator was seen, the default specified in the provider.
  3. Slash - Always uses a regular slash (/)
  4. Backslash - Always uses a backslash ()

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 inTabexpansion2 but 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 fromRegister-ArgumentCompleter and make these options into commands, rather than a PS variable but either option is fine by me.

PR Checklist

mklement0 and JanFeld reacted with thumbs up emojialanlivio reacted with eyes emoji
@ghost
Copy link

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for7 days.
Maintainer, please provide feedback and/or mark it asWaiting on Author

@daxian-dbwdaxian-dbw added the WG-Cmdletsgeneral cmdlet issues labelMay 1, 2023
@daxian-dbwdaxian-dbw marked this pull request as draftMay 1, 2023 18:08
@daxian-dbwdaxian-dbw added the Needs-TriageThe issue is new and needs to be triaged by a work group. labelMay 1, 2023
@ghostghost added the Waiting on AuthorThe PR was reviewed and requires changes or comments from the author before being accept labelMay 5, 2023
@StevenBucher98StevenBucher98 added the PowerShell-Docs neededThe PR was reviewed and a PowerShell Docs update is needed labelMay 8, 2023
@ghostghost added the Stale labelMay 23, 2023
@ghost
Copy link

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for15 days. It will be closed if no further activity occurswithin 10 days of this comment.

@doctordns
Copy link
Collaborator

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?

@ghostghost removed the Stale labelMay 24, 2023
@MartinGC94
Copy link
ContributorAuthor

MartinGC94 commentedMay 24, 2023
edited
Loading

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?

In the execution context (same place that argument completers are stored) so no, it's not persistent.

Also - what is the status on this?

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
With the path completion now merged I can at least add the first couple of options.

konrad-kubacki reacted with rocket emoji

@ghostghost removed the Waiting on AuthorThe PR was reviewed and requires changes or comments from the author before being accept labelMay 24, 2023
@pull-request-quantifier-deprecated

This PR has113 quantified lines of changes. In general, a change size of upto200 lines is ideal for the best PR experience!


Quantification details

Label      : MediumSize       : +105 -8Percentile : 42.6%Total files changed: 4Change summary by file extension:.cs : +105 -8

Change counts above are quantified counts, based on thePullRequestQuantifier customizations.

Why proper sizing of changes matters

Optimal pull request sizes drive a better predictable PR flow as they strike a
balance between between PR complexity and PR review overhead. PRs within the
optimal size (typical small, or medium sized PRs) mean:

  • Fast and predictable releases to production:
    • Optimal size changes are more likely to be reviewed faster with fewer
      iterations.
    • Similarity in low PR complexity drives similar review times.
  • Review quality is likely higher as complexity is lower:
    • Bugs are more likely to be detected.
    • Code inconsistencies are more likely to be detected.
  • Knowledge sharing is improved within the participants:
    • Small portions can be assimilated better.
  • Better engineering practices are exercised:
    • Solving big problems by dividing them in well contained, smaller problems.
    • Exercising separation of concerns within the code changes.

What can I do to optimize my changes

  • Use the PullRequestQuantifier to quantify your PR accurately
    • Create a context profile for your repo using thecontext generator
    • Exclude files that are not necessary to be reviewed or do not increase the review complexity. Example: Autogenerated code, docs, project IDE setting files, binaries, etc. Check out theExcluded section from yourprquantifier.yaml context profile.
    • Understand your typical change complexity, drive towards the desired complexity by adjusting the label mapping in yourprquantifier.yaml context profile.
    • Only use the labels that matter to you,see context specification to customize yourprquantifier.yaml context profile.
  • Change your engineering behaviors
    • For PRs that fall outside of the desired spectrum, review the details and check if:
      • Your PR could be split in smaller, self-contained PRs instead
      • Your PR only solves one particular issue. (For example, don't refactor and code new features in the same PR).

How to interpret the change counts in git diff output

  • One line was added:+1 -0
  • One line was deleted:+0 -1
  • One line was modified:+1 -1 (git diff doesn't know about modified, it will
    interpret that line like one addition plus one deletion)
  • Change percentiles: Change characteristics (addition, deletion, modification)
    of this PR in relation to all other PRs within the repository.


Was this comment helpful?👍 :ok_hand: :thumbsdown: (Email)
Customize PullRequestQuantifier for this repository.

@ghostghost added the Waiting on AuthorThe PR was reviewed and requires changes or comments from the author before being accept labelMay 28, 2023
@ghostghost added the Stale labelJun 12, 2023
@ghost
Copy link

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for15 days. It will be closed if no further activity occurswithin 10 days of this comment.

@MartinGC94
Copy link
ContributorAuthor

@iSazonov Can you reopen this PR? Now that#18955 has been merged I can finally finish this one.

@microsoft-github-policy-servicemicrosoft-github-policy-servicebot removed Waiting on AuthorThe PR was reviewed and requires changes or comments from the author before being accept Stale labelsDec 30, 2024
@iSazonoviSazonov reopened thisDec 31, 2024
@microsoft-github-policy-servicemicrosoft-github-policy-servicebot removed the Review - NeededThe PR is being reviewed labelDec 31, 2024
@MartinGC94MartinGC94 changed the titleWIP: Add commands for controlling completion optionsAdd commands for controlling completion optionsJan 1, 2025
@MartinGC94MartinGC94 marked this pull request as ready for reviewJanuary 1, 2025 15:53
@microsoft-github-policy-servicemicrosoft-github-policy-servicebot added the Review - NeededThe PR is being reviewed labelJan 8, 2025
@microsoft-github-policy-serviceMicrosoft GitHub Policy Service
Copy link
Contributor

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for7 days.
Maintainer, please provide feedback and/or mark it asWaiting on Author

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@TravisEz13TravisEz13

Labels
MediumNeeds-TriageThe issue is new and needs to be triaged by a work group.PowerShell-Docs neededThe PR was reviewed and a PowerShell Docs update is neededReview - NeededThe PR is being reviewedWG-Cmdletsgeneral cmdlet issues
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Better way to handle completion options
6 participants
@MartinGC94@doctordns@daxian-dbw@TravisEz13@StevenBucher98@iSazonov

[8]ページ先頭

©2009-2025 Movatter.jp