Path: blob/main/extensions/copilot/src/extension/chat/vscode-node/chatQuota.contribution.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*--------------------------------------------------------------------------------------------*/4import { commands, env, Uri } from 'vscode';5import { IChatQuotaService } from '../../../platform/chat/common/chatQuotaService';6import { Disposable } from '../../../util/vs/base/common/lifecycle';7import { IExtensionContribution } from '../../common/contributions';89export class ChatQuotaContribution extends Disposable implements IExtensionContribution {10public readonly id = 'chat.quota';1112constructor(@IChatQuotaService chatQuotaService: IChatQuotaService) {13super();14this._register(commands.registerCommand('chat.enableAdditionalUsage', () => {15// Clear quota before opening the page to ensure that if the user enabled additional usage,16// the next request they send won't try to downgrade them to the base model.17chatQuotaService.clearQuota();18env.openExternal(Uri.parse('https://aka.ms/github-copilot-manage-overage'));19}));20}21}222324