Path: blob/main/src/vs/workbench/contrib/editTelemetry/browser/editTelemetry.contribution.ts
5251 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';15import { IRandomService, RandomService } from './randomService.js';1617registerWorkbenchContribution2('EditTelemetryContribution', EditTelemetryContribution, WorkbenchPhase.AfterRestored);1819const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);20configurationRegistry.registerConfiguration({21id: 'task',22order: 100,23title: localize('editTelemetry', "Edit Telemetry"),24type: 'object',25properties: {26[EDIT_TELEMETRY_SETTING_ID]: {27markdownDescription: localize('telemetry.editStats.enabled', "Controls whether to enable telemetry for edit statistics (only sends statistics if general telemetry is enabled)."),28type: 'boolean',29default: true,30tags: ['experimental'],31},32[AI_STATS_SETTING_ID]: {33markdownDescription: localize('editor.aiStats.enabled', "Controls whether to enable AI statistics in the editor. The gauge shows the average AI rate across 5-minute sessions, where each session's rate is calculated as AI-inserted characters divided by total inserted characters."),34type: 'boolean',35default: false,36tags: ['experimental'],37experiment: {38mode: 'auto'39}40},41[EDIT_TELEMETRY_DETAILS_SETTING_ID]: {42markdownDescription: localize('telemetry.editStats.detailed.enabled', "Controls whether to enable telemetry for detailed edit statistics (only sends statistics if general telemetry is enabled)."),43type: 'boolean',44default: false,45tags: ['experimental'],46experiment: {47mode: 'auto'48}49},50[EDIT_TELEMETRY_SHOW_STATUS_BAR]: {51markdownDescription: localize('telemetry.editStats.showStatusBar', "Controls whether to show the status bar for edit telemetry."),52type: 'boolean',53default: false,54tags: ['experimental'],55},56[EDIT_TELEMETRY_SHOW_DECORATIONS]: {57markdownDescription: localize('telemetry.editStats.showDecorations', "Controls whether to show decorations for edit telemetry."),58type: 'boolean',59default: false,60tags: ['experimental'],61},62}63});6465registerSingleton(IAiEditTelemetryService, AiEditTelemetryServiceImpl, InstantiationType.Delayed);66registerSingleton(IRandomService, RandomService, InstantiationType.Delayed);676869