Allow a prediction result to label tokens in it specially to indicate additional information for attention

Open
#3,690 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp, powershell
Domain
cli

Research direction

The issue names no files, tests, or entry points. Start by comparing the two proposed prediction-result approaches and define how a predictor supplies attention labels or presentation text; done means PSReadLine renders selected prediction portions distinctly while preserving current rendering when no extra data is supplied.

Written by the indexing model from the issue text.

Description

Area-Predictors Issue-Enhancement
Prerequisites
  • Write a descriptive title.
Description of the new feature/enhancement

Currently there is no way to render different colors for predictions results. Predictors may want to be able to highlight particular parts of their prediction in order to bring the users attention to it for them to change or check before execution. One example scenario may be for Az Predictor when they give a parameter result that may be important for the user to review before execution like size of a VM. This is a simple mock up of the scenario.

image
Proposed technical implementation details (optional)

There are 2 options from the implementation perspective:

  1. Allow a prediction result to have a new field to store substring spans for labeling substrings, which then will be rendered differently by PSReadLine to indicate "attention needed".

  2. Allow a prediction result to provide "presentation text" along with the plain "suggestion text". The "presentation text" is VT decorated suggestion text, and when it's provided, PSReadLine simply using it for rendering. When it's not provided, PSReadLine do the same rendering as of today based on the "suggestion text".

Dominant language
C#
Stars
4.4k
Forks
341
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PowerShell/PSReadLine

All issues in PowerShell/PSReadLine

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.