Skip to content

Commit f34d48a

Browse files
authored
Add telemetry for settings in release notes (microsoft#205673)
1 parent 035e55c commit f34d48a

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/vs/workbench/contrib/markdown/browser/markdownSettingRenderer.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { DefaultSettings } from 'vs/workbench/services/preferences/common/prefer
1313
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
1414
import { ActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems';
1515
import { IAction } from 'vs/base/common/actions';
16+
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
1617

1718
const codeSettingRegex = /^<code (codesetting)="([^\s"\:]+)(?::([^\s"]+))?">/;
1819
const codeFeatureRegex = /^<span (codefeature)="([^\s"\:]+)(?::([^\s"]+))?">/;
@@ -26,7 +27,8 @@ export class SimpleSettingRenderer {
2627
constructor(
2728
@IConfigurationService private readonly _configurationService: IConfigurationService,
2829
@IContextMenuService private readonly _contextMenuService: IContextMenuService,
29-
@IPreferencesService private readonly _preferencesService: IPreferencesService
30+
@IPreferencesService private readonly _preferencesService: IPreferencesService,
31+
@ITelemetryService private readonly _telemetryService: ITelemetryService
3032
) {
3133
this._defaultSettings = new DefaultSettings([], ConfigurationTarget.USER);
3234
}
@@ -291,6 +293,17 @@ export class SimpleSettingRenderer {
291293

292294
async updateSetting(uri: URI, x: number, y: number) {
293295
if (uri.scheme === Schemas.codeSetting) {
296+
type ReleaseNotesSettingUsedClassification = {
297+
owner: 'alexr00';
298+
comment: 'Used to understand if the the action to update settings from the release notes is used.';
299+
settingId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The id of the setting that was clicked on in the release notes' };
300+
};
301+
type ReleaseNotesSettingUsed = {
302+
settingId: string;
303+
};
304+
this._telemetryService.publicLog2<ReleaseNotesSettingUsed, ReleaseNotesSettingUsedClassification>('releaseNotesSettingAction', {
305+
settingId: uri.authority
306+
});
294307
return this.showContextMenu(uri, x, y);
295308
} else if (uri.scheme === Schemas.codeFeature) {
296309
return this.setFeatureState(uri);

src/vs/workbench/contrib/markdown/test/browser/markdownSettingRenderer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ suite('Markdown Setting Renderer Test', () => {
6161
preferencesService = <IPreferencesService>{};
6262
contextMenuService = <IContextMenuService>{};
6363
Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfiguration(configuration);
64-
settingRenderer = new SimpleSettingRenderer(configurationService, contextMenuService, preferencesService);
64+
settingRenderer = new SimpleSettingRenderer(configurationService, contextMenuService, preferencesService, { publicLog2: () => { } } as any);
6565
});
6666

6767
suiteTeardown(() => {

0 commit comments

Comments
 (0)