Skip to content

Commit 50f9496

Browse files
authored
core: update API to show markdown string in confirmation (microsoft#256990)
update api to use markdown strings
1 parent ce818fc commit 50f9496

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

src/vs/workbench/api/common/extHostTypeConverters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2583,7 +2583,7 @@ export namespace ChatResponseConfirmationPart {
25832583
return {
25842584
kind: 'confirmation',
25852585
title: part.title,
2586-
message: part.message,
2586+
message: MarkdownString.from(part.message),
25872587
data: part.data,
25882588
buttons: part.buttons
25892589
};

src/vs/workbench/api/common/extHostTypes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4588,11 +4588,11 @@ export class ChatResponseMarkdownWithVulnerabilitiesPart {
45884588

45894589
export class ChatResponseConfirmationPart {
45904590
title: string;
4591-
message: string;
4591+
message: string | vscode.MarkdownString;
45924592
data: any;
45934593
buttons?: string[];
45944594

4595-
constructor(title: string, message: string, data: any, buttons?: string[]) {
4595+
constructor(title: string, message: string | vscode.MarkdownString, data: any, buttons?: string[]) {
45964596
this.title = title;
45974597
this.message = message;
45984598
this.data = data;

src/vs/workbench/contrib/chat/common/chatModel.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,10 @@ class AbstractResponse implements IResponse {
369369
segment = { text: localize('editsSummary', "Made changes."), isBlock: true };
370370
break;
371371
case 'confirmation':
372+
if (part.message instanceof MarkdownString) {
373+
segment = { text: `${part.title}\n${part.message.value}`, isBlock: true };
374+
break;
375+
}
372376
segment = { text: `${part.title}\n${part.message}`, isBlock: true };
373377
break;
374378
default:

src/vs/workbench/contrib/chat/common/chatService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export interface IChatNotebookEdit {
220220

221221
export interface IChatConfirmation {
222222
title: string;
223-
message: string;
223+
message: string | IMarkdownString;
224224
data: any;
225225
buttons?: string[];
226226
isUsed?: boolean;

src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ declare module 'vscode' {
6666

6767
export class ChatResponseConfirmationPart {
6868
title: string;
69-
message: string;
69+
message: string | MarkdownString;
7070
data: any;
7171
buttons?: string[];
72-
constructor(title: string, message: string, data: any, buttons?: string[]);
72+
constructor(title: string, message: string | MarkdownString, data: any, buttons?: string[]);
7373
}
7474

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

210210
/**
211211
* Push a warning to this stream. Short-hand for

0 commit comments

Comments
 (0)