55
66import { callWithTelemetryAndErrorHandling , IActionContext , registerCommand } from '@microsoft/vscode-azext-utils' ;
77import * as vscode from 'vscode' ;
8+ import { settingUtils } from '../utils/settingUtils' ;
89import { askAgentAboutResourcePrompt } from './askAgentAboutResource' ;
910
1011const 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
3133async 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