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
3296 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
17
registerWorkbenchContribution2('EditTelemetryContribution', EditTelemetryContribution, WorkbenchPhase.AfterRestored);
18
19
const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);
20
configurationRegistry.registerConfiguration({
21
id: 'task',
22
order: 100,
23
title: localize('editTelemetry', "Edit Telemetry"),
24
type: 'object',
25
properties: {
26
[EDIT_TELEMETRY_SETTING_ID]: {
27
markdownDescription: localize('telemetry.editStats.enabled', "Controls whether to enable telemetry for edit statistics (only sends statistics if general telemetry is enabled)."),
28
type: 'boolean',
29
default: true,
30
tags: ['experimental'],
31
},
32
[AI_STATS_SETTING_ID]: {
33
markdownDescription: 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."),
34
type: 'boolean',
35
default: false,
36
tags: ['experimental'],
37
experiment: {
38
mode: 'auto'
39
}
40
},
41
[EDIT_TELEMETRY_DETAILS_SETTING_ID]: {
42
markdownDescription: localize('telemetry.editStats.detailed.enabled', "Controls whether to enable telemetry for detailed edit statistics (only sends statistics if general telemetry is enabled)."),
43
type: 'boolean',
44
default: false,
45
tags: ['experimental'],
46
experiment: {
47
mode: 'auto'
48
}
49
},
50
[EDIT_TELEMETRY_SHOW_STATUS_BAR]: {
51
markdownDescription: localize('telemetry.editStats.showStatusBar', "Controls whether to show the status bar for edit telemetry."),
52
type: 'boolean',
53
default: false,
54
tags: ['experimental'],
55
},
56
[EDIT_TELEMETRY_SHOW_DECORATIONS]: {
57
markdownDescription: localize('telemetry.editStats.showDecorations', "Controls whether to show decorations for edit telemetry."),
58
type: 'boolean',
59
default: false,
60
tags: ['experimental'],
61
},
62
}
63
});
64
65
registerSingleton(IAiEditTelemetryService, AiEditTelemetryServiceImpl, InstantiationType.Delayed);
66
67