Skip to content

core: update API to show markdown string in confirmation #256990

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

Merged
merged 1 commit into from
Jul 21, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
update api to use markdown strings
  • Loading branch information
justschen committed Jul 21, 2025
commit 8826e4f010809f9b89f5162296b64f711becea72
2 changes: 1 addition & 1 deletion src/vs/workbench/api/common/extHostTypeConverters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2583,7 +2583,7 @@ export namespace ChatResponseConfirmationPart {
return {
kind: 'confirmation',
title: part.title,
message: part.message,
message: MarkdownString.from(part.message),
data: part.data,
buttons: part.buttons
};
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/api/common/extHostTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4588,11 +4588,11 @@ export class ChatResponseMarkdownWithVulnerabilitiesPart {

export class ChatResponseConfirmationPart {
title: string;
message: string;
message: string | vscode.MarkdownString;
data: any;
buttons?: string[];

constructor(title: string, message: string, data: any, buttons?: string[]) {
constructor(title: string, message: string | vscode.MarkdownString, data: any, buttons?: string[]) {
this.title = title;
this.message = message;
this.data = data;
Expand Down
4 changes: 4 additions & 0 deletions src/vs/workbench/contrib/chat/common/chatModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ class AbstractResponse implements IResponse {
segment = { text: localize('editsSummary', "Made changes."), isBlock: true };
break;
case 'confirmation':
if (part.message instanceof MarkdownString) {
segment = { text: `${part.title}\n${part.message.value}`, isBlock: true };
break;
}
segment = { text: `${part.title}\n${part.message}`, isBlock: true };
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/chat/common/chatService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export interface IChatNotebookEdit {

export interface IChatConfirmation {
title: string;
message: string;
message: string | IMarkdownString;
data: any;
buttons?: string[];
isUsed?: boolean;
Expand Down
6 changes: 3 additions & 3 deletions src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ declare module 'vscode' {

export class ChatResponseConfirmationPart {
title: string;
message: string;
message: string | MarkdownString;
data: any;
buttons?: string[];
constructor(title: string, message: string, data: any, buttons?: string[]);
constructor(title: string, message: string | MarkdownString, data: any, buttons?: string[]);
}

export class ChatResponseCodeCitationPart {
Expand Down Expand Up @@ -205,7 +205,7 @@ declare module 'vscode' {
* TODO@API should this be MarkdownString?
* TODO@API should actually be a more generic function that takes an array of buttons
*/
confirmation(title: string, message: string, data: any, buttons?: string[]): void;
confirmation(title: string, message: string | MarkdownString, data: any, buttons?: string[]): void;

/**
* Push a warning to this stream. Short-hand for
Expand Down
Loading