PowerShell / PowerShell/vscode-powershell

Adding Predictive IntelliSense to PowerShell VSCode Extension

Đang mở
#3,301 8 bình luận 5 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Area-IntelliSense Issue-Enhancement
Ngôn ngữ chính
TypeScript
Star
1.9k
Fork
548
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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 like Az.Tools.Predictor to 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:

Picture1

  • Example of ListView in PowerShell Integrated Console:

PowerShelt Integrated Console v2021 2 2

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.

Editor1

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.

Editor2

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Không có tệp mã nguồn, bài kiểm thử hoặc điểm vào nào được nêu. Hãy bắt đầu bằng cách phân rã các yêu cầu của Terminal và Editor, sau đó xem xét cách extension tích hợp với các cài đặt dự đoán và các plugin dự đoán của PSReadLine; được xem là hoàn tất khi các dự đoán lịch sử/plugin được hỗ trợ, các chế độ xem, cấu hình và phím tắt hoạt động như mô tả.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
powershell, typescript, vscode
Lĩnh vực
developer-experience, devtools
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
20/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.