Calling stream.markdown outside ChatRequestHandler #2400
Unanswered
DanaMartens
asked this question in
Extension Development QnA
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I understand that I can use stream.markdown inside the ChatRequestHandler to send a message to the chat window. However, if I have a function where the code is outside the ChatRequestHandler, is there a reliable way to use stream.markdown? I tried passing the stream to the function, but encountered issues where it said the stream was closed. For now, I added the code to a command that is part of the chatParticipant. While this works, it results in the command appearing in the list of / commands, which I do not want.
This may be the same as this dicussion:
microsoft/vscode#211136
Background:
The scenario involves a command that suggests changes to the user's markdown file. When the user clicks a "Preview Changes" button, it previews the changes using the diff feature. Then, I show an "Apply Changes" button to apply the changes to the file. Additionally, an "Undo Changes" button appears in the chat after using "Apply Changes." I want these buttons to appear in the chat window and also want the flexibility to stream a message to the chat window. While I understand that I can use vscode.window.showInformationMessage to show an information message outside the chat window, I don't like the experience it provides in this scenario. The workaround I mentioned earlier results in users being able to see a /previewChanges and /applyChanges command but I don't want them to see this as they are only used internally within a specific scenario.
Beta Was this translation helpful? Give feedback.
All reactions