Fix up chatParticipantAdditions check (#212000)

* Fix up chatParticipantAdditions check

* And copy warning content

* Redundant
This commit is contained in:
Rob Lourens
2024-05-05 12:41:07 +00:00
committed by GitHub
parent 2d6df400a7
commit c20c2ab773
3 changed files with 10 additions and 4 deletions
@@ -125,6 +125,7 @@ class ChatAgentResponseStream {
},
warning(value) {
throwIfDone(this.progress);
checkProposedApiEnabled(that._extension, 'chatParticipantAdditions');
const part = new extHostTypes.ChatResponseWarningPart(value);
const dto = typeConvert.ChatResponseWarningPart.from(part);
_report(dto);
@@ -184,7 +185,12 @@ class ChatAgentResponseStream {
push(part) {
throwIfDone(this.push);
if (part instanceof extHostTypes.ChatResponseTextEditPart || part instanceof extHostTypes.ChatResponseMarkdownWithVulnerabilitiesPart || part instanceof extHostTypes.ChatResponseDetectedParticipantPart) {
if (
part instanceof extHostTypes.ChatResponseTextEditPart ||
part instanceof extHostTypes.ChatResponseMarkdownWithVulnerabilitiesPart ||
part instanceof extHostTypes.ChatResponseDetectedParticipantPart ||
part instanceof extHostTypes.ChatResponseWarningPart
) {
checkProposedApiEnabled(that._extension, 'chatParticipantAdditions');
}
@@ -2455,7 +2455,7 @@ export namespace ChatResponseReferencePart {
export namespace ChatResponsePart {
export function from(part: vscode.ChatResponsePart | vscode.ChatResponseTextEditPart | vscode.ChatResponseMarkdownWithVulnerabilitiesPart | vscode.ChatResponseDetectedParticipantPart, commandsConverter: CommandsConverter, commandDisposables: DisposableStore): extHostProtocol.IChatProgressDto {
export function from(part: vscode.ChatResponsePart | vscode.ChatResponseTextEditPart | vscode.ChatResponseMarkdownWithVulnerabilitiesPart | vscode.ChatResponseDetectedParticipantPart | vscode.ChatResponseWarningPart, commandsConverter: CommandsConverter, commandDisposables: DisposableStore): extHostProtocol.IChatProgressDto {
if (part instanceof types.ChatResponseMarkdownPart) {
return ChatResponseMarkdownPart.from(part);
} else if (part instanceof types.ChatResponseAnchorPart) {
@@ -2474,6 +2474,8 @@ export namespace ChatResponsePart {
return ChatResponseMarkdownWithVulnerabilitiesPart.from(part);
} else if (part instanceof types.ChatResponseDetectedParticipantPart) {
return ChatResponseDetectedParticipantPart.from(part);
} else if (part instanceof types.ChatResponseWarningPart) {
return ChatResponseWarningPart.from(part);
}
return {
@@ -226,8 +226,6 @@ export class Response implements IResponse {
return '';
} else if (part.kind === 'progressMessage') {
return '';
} else if (part.kind === 'warning') {
return '';
} else {
return part.content.value;
}