Fix command buttons in 'push' (#208248)

Fix #207885
This commit is contained in:
Rob Lourens 2024-03-20 17:16:30 -03:00 committed by GitHub
parent 92592894f7
commit abd11f059e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 4 deletions

View file

@ -122,7 +122,7 @@ class ChatAgentResponseStream {
},
push(part) {
throwIfDone(this.push);
const dto = typeConvert.ChatResponsePart.to(part);
const dto = typeConvert.ChatResponsePart.to(part, that._commandsConverter, that._sessionDisposables);
_report(dto);
return this;
},

View file

@ -109,8 +109,13 @@ class ChatVariableResolverResponseStream {
},
push(part) {
throwIfDone(this.push);
const dto = typeConvert.ChatResponsePart.to(part);
_report(dto as IChatVariableResolverProgressDto);
if (part instanceof extHostTypes.ChatResponseReferencePart) {
_report(typeConvert.ChatResponseReferencePart.to(part));
} else if (part instanceof extHostTypes.ChatResponseProgressPart) {
_report(typeConvert.ChatResponseProgressPart.to(part));
}
return this;
}
};

View file

@ -2454,7 +2454,7 @@ export namespace ChatResponseReferencePart {
export namespace ChatResponsePart {
export function to(part: vscode.ChatResponsePart): extHostProtocol.IChatProgressDto {
export function to(part: vscode.ChatResponsePart, commandsConverter: CommandsConverter, commandDisposables: DisposableStore): extHostProtocol.IChatProgressDto {
if (part instanceof types.ChatResponseMarkdownPart) {
return ChatResponseMarkdownPart.to(part);
} else if (part instanceof types.ChatResponseAnchorPart) {
@ -2465,6 +2465,8 @@ export namespace ChatResponsePart {
return ChatResponseProgressPart.to(part);
} else if (part instanceof types.ChatResponseFileTreePart) {
return ChatResponseFilesPart.to(part);
} else if (part instanceof types.ChatResponseCommandButtonPart) {
return ChatResponseCommandButtonPart.to(part, commandsConverter, commandDisposables);
}
return {
kind: 'content',