Path: blob/main/src/vs/workbench/contrib/editTelemetry/browser/editTelemetry.contribution.ts
3296 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*--------------------------------------------------------------------------------------------*/45import { Registry } from '../../../../platform/registry/common/platform.js';6import { EditTelemetryContribution } from './editTelemetryContribution.js';7import { EDIT_TELEMETRY_SETTING_ID, AI_STATS_SETTING_ID } from './settingIds.js';8import { Extensions as ConfigurationExtensions, IConfigurationRegistry } from '../../../../platform/configuration/common/configurationRegistry.js';9import { localize } from '../../../../nls.js';10import { EDIT_TELEMETRY_DETAILS_SETTING_ID, EDIT_TELEMETRY_SHOW_DECORATIONS, EDIT_TELEMETRY_SHOW_STATUS_BAR } from './settings.js';11import { registerWorkbenchContribution2, WorkbenchPhase } from '../../../common/contributions.js';12import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';13import { IAiEditTelemetryService } from './telemetry/aiEditTelemetry/aiEditTelemetryService.js';14import { AiEditTelemetryServiceImpl } from './telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js';1516registerWorkbenchContribution2('EditTelemetryContribution', EditTelemetryContribution, WorkbenchPhase.AfterRestored);1718const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);19configurationRegistry.registerConfiguration({20id: 'task',21order: 100,22title: localize('editTelemetry', "Edit Telemetry"),23type: 'object',24properties: {25[EDIT_TELEMETRY_SETTING_ID]: {26markdownDescription: localize('telemetry.editStats.enabled', "Controls whether to enable telemetry for edit statistics (only sends statistics if general telemetry is enabled)."),27type: 'boolean',28default: true,29tags: ['experimental'],30},31[AI_STATS_SETTING_ID]: {32markdownDescription: localize('editor.aiStats.enabled', "Controls whether to enable AI statistics in the editor. The gauge represents the average amount of code inserted by AI vs manual typing over a 24 hour period."),33type: 'boolean',34default: false,35tags: ['experimental'],36experiment: {37mode: 'auto'38}39},40[EDIT_TELEMETRY_DETAILS_SETTING_ID]: {41markdownDescription: localize('telemetry.editStats.detailed.enabled', "Controls whether to enable telemetry for detailed edit statistics (only sends statistics if general telemetry is enabled)."),42type: 'boolean',43default: false,44tags: ['experimental'],45experiment: {46mode: 'auto'47}48},49[EDIT_TELEMETRY_SHOW_STATUS_BAR]: {50markdownDescription: localize('telemetry.editStats.showStatusBar', "Controls whether to show the status bar for edit telemetry."),51type: 'boolean',52default: false,53tags: ['experimental'],54},55[EDIT_TELEMETRY_SHOW_DECORATIONS]: {56markdownDescription: localize('telemetry.editStats.showDecorations', "Controls whether to show decorations for edit telemetry."),57type: 'boolean',58default: false,59tags: ['experimental'],60},61}62});6364registerSingleton(IAiEditTelemetryService, AiEditTelemetryServiceImpl, InstantiationType.Delayed);656667