PowerShell icon indicating copy to clipboard operation
PowerShell copied to clipboard

Support trigger registration in Feedback Provider

Open daxian-dbw opened this issue 2 years ago • 1 comments

PR Summary

PR Context

Address #19372 and address #19364

  1. Allow a feedback provider to register the trigger for it to be called. The triggers are: Comment, Success, CommandNotFound, Error, and All. By default, a feedback provider will be triggered by CommandNotFound only.
  2. Some refactoring:
    • update the interface method to pass in more context information.
    • split the FeedbackHub.GetFeedback methods into multiple helper methods to reduce its complexity.

PR Checklist

daxian-dbw avatar Apr 17 '23 23:04 daxian-dbw

It's helpful to ignore the whitespace changes during the review: https://github.com/PowerShell/PowerShell/pull/19525/files?w=1

daxian-dbw avatar Apr 17 '23 23:04 daxian-dbw

:tada:v7.4.0-preview.3 has been released which incorporates this pull request.:tada:

Handy links:

ghost avatar Apr 20 '23 17:04 ghost

@daxian-dbw sorry to be late to the party on this, but I don't think the feedback trigger should have a default, it should be explicitly implemented. This bit me when writing a provider because when I used my IDE to implement the interface, it didn't pull this in and I couldn't figure out why it wasn't working. Since it is RC it may be too late since this would be breaking for existing feedback providers that haven't explicitly stated it, but just a thought.

JustinGrote avatar Oct 27 '23 00:10 JustinGrote