Hook up PSES events to PSEventManager
還沒有人認領這個 Issue。
評估
研究方向
先追蹤元件註冊表中現有的 IMessageHandlers,並將提議的 Register-EditorEvent 行為與 Register-EngineEvent、PSEventSubscriber 和 PSEngineEvent 進行比較。定義事件名稱常數、訂閱者註冊、處理常式分派、runspace 排隊以及 EventArgs 輸出行為;完成的標準是多個 PowerShell 和編譯型語言處理常式可以共存,而不會取代現有的處理常式。
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- C#
- 星號
- 767
- 分支
- 266
- 平均合併
- 3 天 16 小時
- 30 天內合併 PR
- 1
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
PowerShell/PowerShellEditorServices 的其他 Issue
-
[Bug] None of the string overloads of `EditorExtensionServiceProvider.GetService()` work on .NET. 未關閉
PowerShell/PowerShellEditorServices#2331 · 1 個 reaction · 已指派 2 人 ·
-
Area-Language Server Issue-Enhancement
難度 4/5 3-5 天 新手友好度 48/100
PowerShell/PowerShellEditorServices#2315 · 1 則留言 ·
-
Area-Debugging Issue-Enhancement
PowerShell/PowerShellEditorServices#2294 · 1 個 reaction · 已指派 2 人 ·
-
Issue-Bug Needs: Triage
難度 4/5 3-5 天 新手友好度 48/100
PowerShell/PowerShellEditorServices#2293 · 1 則留言 ·
-
PowerShell/PowerShellEditorServices#2282 · 1 則留言 · 1 個 reaction · 已指派 2 人 ·
查看 PowerShell/PowerShellEditorServices 的全部 Issue
相似的 Issue
-
Documentation
難度 2/5 1-3 小時 新手友好度 75/100
cake-build/cake#5024 ·
-
Frontend status/draft TechnicalDebt
難度 2/5 1-2 天 新手友好度 75/100
Altinn/altinn-auth#4143 ·
-
.NET Flaky Test Testing Tests
難度 2/5 1-3 小時 新手友好度 84/100
getsentry/sentry-dotnet#5617 · 1 則留言 ·
-
:watch: Not Triaged dotnet-fsharp/svc
難度 1/5 1 小時以內 新手友好度 90/100
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
難度 2/5 1-3 小時 新手友好度 76/100
Azure/azure-sdk-for-net#63292 · 3 則留言 · 1 個 reaction ·