Skip to content

ListView in Predictive IntelliSense should order predictors by last accepted #2922

Open
@theJasonHelmick

Description

@theJasonHelmick

Description of the new feature/enhancement

PowerShell users should expect that the most relevant predictions are displayed first in ListView. This issue proposes changing the sort order of predictions to display predictions from the most recently accepted predictor first.

Current ListView display order

Currently, The ListView in Predictive IntelliSense provides a list of up to 10 predictions from history and/or additional predictors.

Screen Shot 2021-10-14 at 8 13 59 AM

  • Note - two predictors are displayed above, History and AZ Predictor.

Currently, ListView displays predictions based on the following:

  • History is displayed first unless disabled. History gets a maximum of 3 lines.
    • To disable: Set-PSReadLineOption -PredictionSource Plugin
  • History-based predictions are treated special and are always listed at the top in the first 3 lines.
  • After history, the remaining lines are allocated to the imported predictors.
    • Example:
    • If history only needs 2 lines, then 8 lines are available for additional predictors.
    • If two predictors are imported, then P1 and P2 will each be allocated 4 lines.
    • If P1 only needs 3 lines, the remaining lines are allocated to the remaining predictors - in this case P2 would get 5 lines.
  • What is displayed first, after History?
    • Additional predictors are displayed in the order in which their modules are loaded. (Either manually or in the users profile)

Proposed technical implementation details (optional)

Proposal:

PowerShell users using domain specific predictors would benefit from having the current working domain listed first in Listview. For instance, a user working with Azure may select a prediction beginning with New-AzResourceGroup. This user would benefit from having ListView display the AZ Predictor first in the list until another domain specific predictor is accepted. Currently, the user must remove, then import, the predictors in the order which they want displayed.

The order of the displayed predictions should be based on most recently accepted

  • The History predictor should be treated as any other predictor and subject to being re-ordered.
  • Predictors should be listed in the order of most recently accepted
    • Note- an accepted predictions is a prediction from a predictor that is displayed, selected and executed by the user.
  • ListView should display the most recently accepted predictor at the top.
  • When the user accepts a prediction from a different predictor, the new accepted predictor is now displayed at the top of ListView.

Metadata

Metadata

Labels

Area-PredictorsLabel for issues related to predictorsIssue-EnhancementIt's a feature request.Issue-TriagedIt indicates an issue was triaged

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions