diff --git a/src/chat/chatStandIn.ts b/src/chat/chatStandIn.ts index e9779c67d..bbbe5ead1 100644 --- a/src/chat/chatStandIn.ts +++ b/src/chat/chatStandIn.ts @@ -5,6 +5,7 @@ import { callWithTelemetryAndErrorHandling, IActionContext, registerCommand } from '@microsoft/vscode-azext-utils'; import * as vscode from 'vscode'; +import { settingUtils } from '../utils/settingUtils'; import { askAgentAboutResourcePrompt } from './askAgentAboutResource'; const GitHubCopilotForAzureExtensionId = 'ms-azuretools.vscode-azure-github-copilot'; @@ -26,6 +27,7 @@ export function registerChatStandInParticipantIfNeeded(context: vscode.Extension context.subscriptions.push(chatStandInParticipant); registerCommand('azureResourcesGroups.installGitHubCopilotForAzureFromChat', installGitHubCopilotForAzureFromChat); + registerCommand('azureResourceGroups.updateChatStandInSetting', updateChatStandInSetting); } async function chatStandIn( @@ -41,8 +43,13 @@ async function chatStandIn( command: 'azureResourcesGroups.installGitHubCopilotForAzureFromChat', }); + responseStream.button({ + title: vscode.l10n.t(`Don't ask me again`), + command: 'azureResourceGroups.updateChatStandInSetting' + }); + const postButtonMessage = request.prompt === askAgentAboutResourcePrompt ? vscode.l10n.t(`After that, please use \`Ask @azure\` again.`) : - vscode.l10n.t('After that, please repeat your question.'); + vscode.l10n.t(`After that, please repeat your question.`); responseStream.markdown(postButtonMessage); } @@ -54,3 +61,7 @@ async function installGitHubCopilotForAzureFromChat(context: IActionContext): Pr context.telemetry.properties.result = 'Canceled'; } } + +async function updateChatStandInSetting(): Promise { + await settingUtils.updateGlobalSetting('enableChatStandIn', false); +}