Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix up chatParticipantAdditions check #212000

Merged
merged 3 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/vs/workbench/api/common/extHostChatAgents2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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');
}

Expand Down
4 changes: 3 additions & 1 deletion src/vs/workbench/api/common/extHostTypeConverters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions src/vs/workbench/contrib/chat/common/chatModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down