Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/editTelemetry/browser/editTelemetry.contribution.ts
5251 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { Registry } from '../../../../platform/registry/common/platform.js';
7
import { EditTelemetryContribution } from './editTelemetryContribution.js';
8
import { EDIT_TELEMETRY_SETTING_ID, AI_STATS_SETTING_ID } from './settingIds.js';
9
import { Extensions as ConfigurationExtensions, IConfigurationRegistry } from '../../../../platform/configuration/common/configurationRegistry.js';
10
import { localize } from '../../../../nls.js';
11
import { EDIT_TELEMETRY_DETAILS_SETTING_ID, EDIT_TELEMETRY_SHOW_DECORATIONS, EDIT_TELEMETRY_SHOW_STATUS_BAR } from './settings.js';
12
import { registerWorkbenchContribution2, WorkbenchPhase } from '../../../common/contributions.js';
13
import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';
14
import { IAiEditTelemetryService } from './telemetry/aiEditTelemetry/aiEditTelemetryService.js';
15
import { AiEditTelemetryServiceImpl } from './telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js';
16
import { IRandomService, RandomService } from './randomService.js';
17
18
registerWorkbenchContribution2('EditTelemetryContribution', EditTelemetryContribution, WorkbenchPhase.AfterRestored);
19
20
const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);
21
configurationRegistry.registerConfiguration({
22
id: 'task',
23
order: 100,
24
title: localize('editTelemetry', "Edit Telemetry"),
25
type: 'object',
26
properties: {
27
[EDIT_TELEMETRY_SETTING_ID]: {
28
markdownDescription: localize('telemetry.editStats.enabled', "Controls whether to enable telemetry for edit statistics (only sends statistics if general telemetry is enabled)."),
29
type: 'boolean',
30
default: true,
31
tags: ['experimental'],
32
},
33
[AI_STATS_SETTING_ID]: {
34
markdownDescription: 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."),
35
type: 'boolean',
36
default: false,
37
tags: ['experimental'],
38
experiment: {
39
mode: 'auto'
40
}
41
},
42
[EDIT_TELEMETRY_DETAILS_SETTING_ID]: {
43
markdownDescription: localize('telemetry.editStats.detailed.enabled', "Controls whether to enable telemetry for detailed edit statistics (only sends statistics if general telemetry is enabled)."),
44
type: 'boolean',
45
default: false,
46
tags: ['experimental'],
47
experiment: {
48
mode: 'auto'
49
}
50
},
51
[EDIT_TELEMETRY_SHOW_STATUS_BAR]: {
52
markdownDescription: localize('telemetry.editStats.showStatusBar', "Controls whether to show the status bar for edit telemetry."),
53
type: 'boolean',
54
default: false,
55
tags: ['experimental'],
56
},
57
[EDIT_TELEMETRY_SHOW_DECORATIONS]: {
58
markdownDescription: localize('telemetry.editStats.showDecorations', "Controls whether to show decorations for edit telemetry."),
59
type: 'boolean',
60
default: false,
61
tags: ['experimental'],
62
},
63
}
64
});
65
66
registerSingleton(IAiEditTelemetryService, AiEditTelemetryServiceImpl, InstantiationType.Delayed);
67
registerSingleton(IRandomService, RandomService, InstantiationType.Delayed);
68
69