✨ streaming
This commit is contained in:
parent
cc9f057454
commit
3a39b4b28c
1 changed files with 11 additions and 1 deletions
|
|
@ -65,7 +65,17 @@ export class VsCodeWebviewProtocol {
|
|||
for (const handler of handlers) {
|
||||
try {
|
||||
const response = await handler(msg);
|
||||
respond(response || {});
|
||||
if (
|
||||
response &&
|
||||
typeof response[Symbol.asyncIterator] === "function"
|
||||
) {
|
||||
for await (const update of response) {
|
||||
respond(update);
|
||||
}
|
||||
respond({ done: true });
|
||||
} else {
|
||||
respond(response || {});
|
||||
}
|
||||
} catch (e: any) {
|
||||
console.error(
|
||||
"Error handling webview message: " +
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue