Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/chat/chatStandIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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(
Expand All @@ -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);
}

Expand All @@ -54,3 +61,7 @@ async function installGitHubCopilotForAzureFromChat(context: IActionContext): Pr
context.telemetry.properties.result = 'Canceled';
}
}

async function updateChatStandInSetting(): Promise<void> {
await settingUtils.updateGlobalSetting('enableChatStandIn', false);
}