Hook up PSES events to PSEventManager
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi các IMessageHandlers hiện có trong component registry và so sánh hành vi được đề xuất của Register-EditorEvent với Register-EngineEvent, PSEventSubscriber và PSEngineEvent. Xác định các hằng số tên sự kiện, việc đăng ký subscriber, việc phân phối tới handler, việc xếp hàng vào runspace và hành vi đầu ra của EventArgs; được xem là hoàn tất khi nhiều handler của PowerShell và các ngôn ngữ biên dịch có thể cùng tồn tại mà không thay thế các handler hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Right now the only way to register event/request handlers is to override them via IMessageHandlers from the component registry. This has a few issues
-
As far as I can tell this only allows you to override handlers, not add to them. Doing this as part of an extension module would break existing functionality.
-
These delegates are invoked from a thread that doesn't have a default runspace. This means if the delegate is a converted script block it will fail (and crash PSES)
I propose we add the following:
-
Function or cmdlet
Register-EditorEvent. This should work likeRegister-EngineEvent. It would take aSourceIdentifieras the event name and script block to register as aPSEventSubscriber. Ideally this would also include argument completion for event names. -
A class that holds constants with event names (see
PSEngineEvent) -
Additional logic to existing handlers and other events to check for relevant event subscribers and if found generate the event.
-
If the event/handler typically returns a value, a property would need to be added to the
EventArgsto handle output (PowerShell eventing doesn't handle delegate output)
This would solve a few issues
-
Extension modules could register additional handlers the same way in PowerShell and compiled languages
-
Eventing should take care of all the runspace management and queuing of commands that would normally make this a huge pain. This would also allow the events to be ran in between sequence points of an in progress command.
-
Allow multiple handlers for a single request/event
- Ngôn ngữ chính
- C#
- Star
- 767
- Fork
- 266
- Merge trung bình
- 3 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PowerShell/PowerShellEditorServices
-
[Bug] None of the string overloads of `EditorExtensionServiceProvider.GetService()` work on .NET. Đang mở
PowerShell/PowerShellEditorServices#2331 · 1 reaction · 2 người được giao ·
-
Area-Language Server Issue-Enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
PowerShell/PowerShellEditorServices#2315 · 1 bình luận ·
-
Area-Debugging Issue-Enhancement
PowerShell/PowerShellEditorServices#2294 · 1 reaction · 2 người được giao ·
-
Issue-Bug Needs: Triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
PowerShell/PowerShellEditorServices#2293 · 1 bình luận ·
-
PowerShell/PowerShellEditorServices#2282 · 1 bình luận · 1 reaction · 2 người được giao ·
Tất cả issue của PowerShell/PowerShellEditorServices
Issue tương tự
-
Documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
cake-build/cake#5024 ·
-
Gå gjennom ESLint-suppressions Đang mởFrontend status/draft TechnicalDebt
Độ khó 2/5 1-2 ngày Mức phù hợp với người mới 75/100
Altinn/altinn-auth#4143 ·
-
.NET Flaky Test Testing Tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
getsentry/sentry-dotnet#5617 · 1 bình luận ·
-
Add more to the documentation Đang mở:watch: Not Triaged dotnet-fsharp/svc
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Azure/azure-sdk-for-net#63292 · 3 bình luận · 1 reaction ·