PowerShell / PowerShell/vscode-powershell

Feature Request: Call VSCode commands from $psEditor variable

Đang mở
#804 4 bình luận 4 reaction 0 người được giao Xem trên GitHub

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

Area-psEditor 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ả

It would be really cool if a PowerShell script were able to invoke VSCode commands, effectively automating the IDE from PowerShell. This could be exposed via the built-in $psEditor variable that's accessible in the VSCode-PowerShell environment.

Related to #773, but more broad.

If there's already a way to do this, I'd love to hear it. I've explored the Workspace and Window variables on the $psEditor object, along with the GetEditorContext() method output, and can't find any way to do this right now.

PS /Users/tsulli> $psEditor |gm

   TypeName: Microsoft.PowerShell.EditorServices.Extensions.EditorObject

Name                  MemberType Definition
----                  ---------- ----------
Equals                Method     bool Equals(System.Object obj)
GetEditorContext      Method     Microsoft.PowerShell.EditorServices.Extensions.EditorContext GetEditorContext()
GetHashCode           Method     int GetHashCode()
GetType               Method     type GetType()
RegisterCommand       Method     bool RegisterCommand(Microsoft.PowerShell.EditorServices.Extensions.EditorCommand editorCommand)
ToString              Method     string ToString()
UnregisterCommand     Method     void UnregisterCommand(string commandName)
EditorServicesVersion Property   version EditorServicesVersion {get;}
Window                Property   Microsoft.PowerShell.EditorServices.Extensions.EditorWindow Window {get;}
Workspace             Property   Microsoft.PowerShell.EditorServices.Extensions.EditorWorkspace Workspace {get;}

Cheers,
Trevor Sullivan

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

Bắt đầu bằng cách xem xét API EditorObject tích hợp sẵn của $psEditor, đặc biệt là các member Workspace, Window, GetEditorContext(), RegisterCommand() và UnregisterCommand(), đồng thời so sánh yêu cầu rộng hơn với issue liên quan #773. Công việc được xem là hoàn tất khi một script PowerShell trong môi trường VSCode-PowerShell có thể gọi các lệnh VSCode thông qua $psEditor.

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, tooling
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
Cần làm rõ
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.