Make chat participant 'isSticky' static (#208498)

Also fix more agent IDs showing up in intellisense
Fix #207517
This commit is contained in:
Rob Lourens 2024-03-23 19:11:50 -03:00 committed by GitHub
parent f23beb2475
commit 9b215e88df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 12 additions and 19 deletions

View file

@ -360,7 +360,6 @@ class ExtHostChatAgent {
private _supportIssueReporting: boolean | undefined;
private _agentVariableProvider?: { provider: vscode.ChatParticipantCompletionItemProvider; triggerCharacters: string[] };
private _welcomeMessageProvider?: vscode.ChatWelcomeMessageProvider | undefined;
private _isSticky: boolean | undefined;
private _requester: vscode.ChatRequesterInformation | undefined;
constructor(
@ -461,7 +460,6 @@ class ExtHostChatAgent {
helpTextPostfix: (!this._helpTextPostfix || typeof this._helpTextPostfix === 'string') ? this._helpTextPostfix : typeConvert.MarkdownString.from(this._helpTextPostfix),
sampleRequest: this._sampleRequest,
supportIssueReporting: this._supportIssueReporting,
isSticky: this._isSticky,
requester: this._requester
});
updateScheduled = false;
@ -597,13 +595,6 @@ class ExtHostChatAgent {
? undefined!
: this._onDidPerformAction.event
,
get isSticky() {
return that._isSticky;
},
set isSticky(v) {
that._isSticky = v;
updateMetadataSoon();
},
set requester(v) {
that._requester = v;
updateMetadataSoon();

View file

@ -91,6 +91,10 @@ const chatParticipantExtensionPoint = extensionsRegistry.ExtensionsRegistry.regi
markdownDescription: localize('chatParticipantIsDefaultDescription', "**Only** allowed for extensions that have the `defaultChatParticipant` proposal."),
type: 'boolean',
},
isSticky: {
description: localize('chatCommandSticky', "Whether invoking the command puts the chat into a persistent mode, where the command is automatically added to the chat input for the next message."),
type: 'boolean'
},
defaultImplicitVariables: {
markdownDescription: '**Only** allowed for extensions that have the `chatParticipantAdditions` proposal. The names of the variables that are invoked by default',
type: 'array',
@ -116,15 +120,15 @@ const chatParticipantExtensionPoint = extensionsRegistry.ExtensionsRegistry.regi
type: 'string'
},
when: {
description: localize('chatCommandDescription', "A description of this command."),
description: localize('chatCommandWhen', "A condition which must be true to enable this command."),
type: 'string'
},
sampleRequest: {
description: localize('chatCommandDescription', "A description of this command."),
description: localize('chatCommandSampleRequest', "When the user clicks this command in `/help`, this text will be submitted to this participant."),
type: 'string'
},
isSticky: {
description: localize('chatCommandDescription', "A description of this command."),
description: localize('chatCommandSticky', "Whether invoking the command puts the chat into a persistent mode, where the command is automatically added to the chat input for the next message."),
type: 'boolean'
},
defaultImplicitVariables: {
@ -265,7 +269,9 @@ export class ChatExtensionPointHandler implements IWorkbenchContribution {
extensionId: extension.description.identifier,
id: providerDescriptor.id,
description: providerDescriptor.description,
metadata: {},
metadata: {
isSticky: providerDescriptor.isSticky,
},
name: providerDescriptor.name,
isDefault: providerDescriptor.isDefault,
defaultImplicitVariables: providerDescriptor.defaultImplicitVariables,

View file

@ -445,7 +445,7 @@ class AgentCompletions extends Disposable {
.map(agent => {
const isDupe = !!agents.find(other => other.name === agent.name && other.id !== agent.id);
const detail = agent.description;
const agentLabel = `${chatAgentLeader}${agent.name} (${agent.id})`;
const agentLabel = `${chatAgentLeader}${agent.name}`;
return {
label: isDupe ?

View file

@ -44,6 +44,7 @@ export interface IRawChatParticipantContribution {
name: string;
description?: string;
isDefault?: boolean;
isSticky?: boolean;
commands?: IRawChatCommandContribution[];
defaultImplicitVariables?: string[];
locations?: RawChatParticipantLocation[];

View file

@ -225,11 +225,6 @@ declare module 'vscode' {
*/
sampleRequest?: string;
/**
* Whether invoking the participant puts the chat into a persistent mode, where the participant is automatically added to the chat input for the next message.
*/
isSticky?: boolean;
/**
* An event that fires whenever feedback for a result is received, e.g. when a user up- or down-votes
* a result.