Skip to content

Commit 42d35ef

Browse files
authored
Fix dynamic sampleRequest (#211659)
Fix microsoft/vscode-copilot-release#1165
1 parent aefdf5b commit 42d35ef

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ class ExtHostChatAgent {
408408
private _helpTextPrefix: string | vscode.MarkdownString | undefined;
409409
private _helpTextVariablesPrefix: string | vscode.MarkdownString | undefined;
410410
private _helpTextPostfix: string | vscode.MarkdownString | undefined;
411+
private _sampleRequest?: string;
411412
private _isSecondary: boolean | undefined;
412413
private _onDidReceiveFeedback = new Emitter<vscode.ChatResultFeedback>();
413414
private _onDidPerformAction = new Emitter<vscode.ChatUserActionEvent>();
@@ -512,6 +513,7 @@ class ExtHostChatAgent {
512513
helpTextPrefix: (!this._helpTextPrefix || typeof this._helpTextPrefix === 'string') ? this._helpTextPrefix : typeConvert.MarkdownString.from(this._helpTextPrefix),
513514
helpTextVariablesPrefix: (!this._helpTextVariablesPrefix || typeof this._helpTextVariablesPrefix === 'string') ? this._helpTextVariablesPrefix : typeConvert.MarkdownString.from(this._helpTextVariablesPrefix),
514515
helpTextPostfix: (!this._helpTextPostfix || typeof this._helpTextPostfix === 'string') ? this._helpTextPostfix : typeConvert.MarkdownString.from(this._helpTextPostfix),
516+
sampleRequest: this._sampleRequest,
515517
supportIssueReporting: this._supportIssueReporting,
516518
requester: this._requester
517519
});
@@ -599,6 +601,13 @@ class ExtHostChatAgent {
599601
that._isSecondary = v;
600602
updateMetadataSoon();
601603
},
604+
get sampleRequest() {
605+
return that._sampleRequest;
606+
},
607+
set sampleRequest(v) {
608+
that._sampleRequest = v;
609+
updateMetadataSoon();
610+
},
602611
get supportIssueReporting() {
603612
checkProposedApiEnabled(that.extension, 'chatParticipantAdditions');
604613
return that._supportIssueReporting;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ declare module 'vscode' {
209209
dark: Uri;
210210
} | ThemeIcon;
211211

212+
/**
213+
* When the user clicks this participant in `/help`, this text will be submitted to this participant.
214+
*/
215+
sampleRequest?: string;
216+
212217
/**
213218
* The handler for requests to this participant.
214219
*/

0 commit comments

Comments
 (0)