Skip to content

Commit 6c596f5

Browse files
committed
Enforce unsupported boolean flag for MarkdownString in chat
1 parent ef35ae4 commit 6c596f5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4272,6 +4272,10 @@ export enum ChatResultFeedbackKind {
42724272
export class ChatResponseMarkdownPart {
42734273
value: vscode.MarkdownString;
42744274
constructor(value: string | vscode.MarkdownString) {
4275+
if (typeof value !== 'string' && value.isTrusted === true) {
4276+
throw new Error('The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.');
4277+
}
4278+
42754279
this.value = typeof value === 'string' ? new MarkdownString(value) : value;
42764280
}
42774281
}
@@ -4284,6 +4288,10 @@ export class ChatResponseMarkdownWithVulnerabilitiesPart {
42844288
value: vscode.MarkdownString;
42854289
vulnerabilities: vscode.ChatVulnerability[];
42864290
constructor(value: string | vscode.MarkdownString, vulnerabilities: vscode.ChatVulnerability[]) {
4291+
if (typeof value !== 'string' && value.isTrusted === true) {
4292+
throw new Error('The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.');
4293+
}
4294+
42874295
this.value = typeof value === 'string' ? new MarkdownString(value) : value;
42884296
this.vulnerabilities = vulnerabilities;
42894297
}

0 commit comments

Comments
 (0)