Skip to content

Commit ae32191

Browse files
authored
Add button to chat stand in to disable enableChatStandIn setting (#1256)
* button to disable setting * move button * remove
1 parent 1e42728 commit ae32191

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/chat/chatStandIn.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import { callWithTelemetryAndErrorHandling, IActionContext, registerCommand } from '@microsoft/vscode-azext-utils';
77
import * as vscode from 'vscode';
8+
import { settingUtils } from '../utils/settingUtils';
89
import { askAgentAboutResourcePrompt } from './askAgentAboutResource';
910

1011
const GitHubCopilotForAzureExtensionId = 'ms-azuretools.vscode-azure-github-copilot';
@@ -26,6 +27,7 @@ export function registerChatStandInParticipantIfNeeded(context: vscode.Extension
2627

2728
context.subscriptions.push(chatStandInParticipant);
2829
registerCommand('azureResourcesGroups.installGitHubCopilotForAzureFromChat', installGitHubCopilotForAzureFromChat);
30+
registerCommand('azureResourceGroups.updateChatStandInSetting', updateChatStandInSetting);
2931
}
3032

3133
async function chatStandIn(
@@ -41,8 +43,13 @@ async function chatStandIn(
4143
command: 'azureResourcesGroups.installGitHubCopilotForAzureFromChat',
4244
});
4345

46+
responseStream.button({
47+
title: vscode.l10n.t(`Don't ask me again`),
48+
command: 'azureResourceGroups.updateChatStandInSetting'
49+
});
50+
4451
const postButtonMessage = request.prompt === askAgentAboutResourcePrompt ? vscode.l10n.t(`After that, please use \`Ask @azure\` again.`) :
45-
vscode.l10n.t('After that, please repeat your question.');
52+
vscode.l10n.t(`After that, please repeat your question.`);
4653
responseStream.markdown(postButtonMessage);
4754
}
4855

@@ -54,3 +61,7 @@ async function installGitHubCopilotForAzureFromChat(context: IActionContext): Pr
5461
context.telemetry.properties.result = 'Canceled';
5562
}
5663
}
64+
65+
async function updateChatStandInSetting(): Promise<void> {
66+
await settingUtils.updateGlobalSetting('enableChatStandIn', false);
67+
}

0 commit comments

Comments
 (0)