Draft: DuoChat: explain terminal output
Description
Adds new command for explaining output from the VSCode integrated terminal.
- adds new terminal context menu item
- when using new menu, tries to get the current selected terminal output
- sends to chat as
/explain
with newexplainOutput
sub-type (TODO: confirm this matches backend implementation)
A workaround is used for getting the currently selected terminal output, since no such API exists within VSCode currently. This involves setting/reading the users clipboard, so we also try to restore the clipboard to the original value once we're done, to minimise distruption.
TODO: docs TODO: test once backend is ready
Related Issues
Resolves #1423
How has this been tested?
TODO
Screenshots (if appropriate)
Note: the warning message when terminal has no selection comes from VSCode itself when we try set the terminal selection to the clipboard. We cannot control that warning as far as I can tell
Note2: I don't see any way to hide the new context menu item when there is no selection, since there are no APIs for getting the terminal output. So it will always be included when right clicking the terminal, and we just have to deal with the case of no selection.
What CHANGELOG entry will this MR create?
-
fix:
Bug fix fixes - a user-facing issue in production - included in changelog -
feature:
New feature - a user-facing change which adds functionality - included in changelog -
BREAKING CHANGE:
(fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog -
None - other non-user-facing changes
Closes #1423