Path: blob/main/extensions/copilot/src/extension/conversation/vscode-node/welcomeMessageProvider.ts
13399 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/456import * as vscode from 'vscode';7import { ICopilotTokenStore } from '../../../platform/authentication/common/copilotTokenStore';8import { ConfigKey, IConfigurationService } from '../../../platform/configuration/common/configurationService';9import { ServicesAccessor } from '../../../util/vs/platform/instantiation/common/instantiation';101112export function getAdditionalWelcomeMessage(accessor: ServicesAccessor): vscode.MarkdownString | undefined {13const configurationService = accessor.get(IConfigurationService);14const copilotTokenStore = accessor.get(ICopilotTokenStore);15const isInternalOrTeam = !!copilotTokenStore.copilotToken?.isInternal || !!copilotTokenStore.copilotToken?.isVscodeTeamMember;16// For internal/team users, default to showing the hint unless the user has explicitly disabled it17const showHint = isInternalOrTeam && !configurationService.isConfigured(ConfigKey.TeamInternal.InternalWelcomeHintEnabled)18? true19: configurationService.getConfig(ConfigKey.TeamInternal.InternalWelcomeHintEnabled);20if (showHint) {21const openSettingsCommand = 'workbench.action.openSettings';22const messageString = new vscode.MarkdownString(vscode.l10n.t({23message: 'If handling customer data, [disable telemetry]({0}).',24args: [`command:${openSettingsCommand}?${encodeURIComponent('["telemetry.telemetryLevel"]')}`],25// To make sure the translators don't break the link26comment: [`{Locked=']({'}`]27}));28messageString.isTrusted = { enabledCommands: [openSettingsCommand] };29return messageString;30}31return undefined;32}333435