PowerShell / PowerShell/vscode-powershell
Adding Predictive IntelliSense to PowerShell VSCode Extension
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 1.9k
- フォーク
- 547
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Adding Predictive IntelliSense to PowerShell VSCode Extension
Summary of new feature
Predictive IntelliSense is an addition to the concept of tab completion that assists the user in
successfully completing commands. This enables new and experienced users of PowerShell to discover,
edit, and execute full commands based on matching predictions from the users history and additional
domain specific plugins such as
Az.Tools.Predictor.
PowerShell users would benefit from predictions in VSCode Terminal (PowerShell Integrated Console)
and Editor:
-
PowerShell users with previous cmdlet experience receive suggestions from history and additional
plugins, accelerating the time to command completion. Historical predictions come from the users
PSReadLine history of completed commands, allowing them to quickly accept the prediction. -
PowerShell users without previous cmdlet experience receive guided suggestions from plugin
predictors likeAz.Tools.Predictorto help successfully complete the command. These plugins may
provide a range of guided assistance in the form of complete commands or suggesting parameters and
arguments.
Terminal
Terminal (PowerShell Integrated Console), should have the same features as PowerShell (shell) with
predictions as described in this
blog.
This includes InLineView and ListView for predictions, switchable with F2 key.
- Example of InLineView in PowerShell Integrated Console:

- Example of ListView in PowerShell Integrated Console:

Editor
Displaying predictions in the editor could be similar to IntelliCode for Visual Studio described
here.
When the user begins to type a cmdlet, a prediction using InLineView appears above other cmdlet
names. A star indicates that the suggestion comes from a predictor, followed by the InLineView
prediction, followed by the prediction source.

After the cmdlet name, when the user types dash (-) to begin a parameter, the first suggestion pair
(parameter and argument) is displayed along with the prediction source. As the user continues to
type the next parameter with a dash, the next suggestion pair is displayed until the prediction is
complete.

In the above example, the Az.Tools.Predictor will suggest the parameter and argument based on:
- Examples - Ml-based plugins may learn the most common uses of a cmdlet from documentation examples.
- Reuse - If the parameter and argument pair has been previously typed within the current session,
the predictor will supply the previously typed argument. - Syntax - If no examples or history is available, the predictor will display the parameter with the
Object type for the argument.
Enabling/Disabling
Predictions are enabled and disabled using the Set-PSReadLineOption -PredictionSource <argument>
and may be stored in the users profile. Accepted values for the argument are None, History,
HistoryAndPlugin.
Configuring a predictor
Customizing prediction color, keybindings, and additional plugins is accomplished through PSReadLine
Set-PSReadLineOption and Set-PSReadLineKeyHandler cmdlets. Custom settings may be stored in the
users profile.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ソースファイル、テスト、エントリーポイントは指定されていません。まず Terminal と Editor の要件を分解し、次に拡張機能が PSReadLine の予測設定および予測プラグインとどのように統合されるかを確認してください。履歴/プラグインの予測、ビュー、構成、キーバインディングが説明どおりに機能すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- powershell, typescript, vscode
- 領域
- developer-experience, devtools
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 20/100