mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
More strongly typed telemetry events (#77658)
* More strongly typed events * Fixed typo
This commit is contained in:
@@ -24,6 +24,10 @@ import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
|
||||
export type ServicesAccessor = ServicesAccessor;
|
||||
export type IEditorContributionCtor = IConstructorSignature1<ICodeEditor, IEditorContribution>;
|
||||
export type EditorTelemetryDataFragment = {
|
||||
target: { classification: 'SystemMetaData', purpose: 'FeatureInsight' };
|
||||
snippet: { classification: 'SystemMetaData', purpose: 'FeatureInsight', isMeasurement: true };
|
||||
};
|
||||
|
||||
//#region Command
|
||||
|
||||
@@ -219,16 +223,15 @@ export abstract class EditorAction extends EditorCommand {
|
||||
}
|
||||
|
||||
protected reportTelemetry(accessor: ServicesAccessor, editor: ICodeEditor) {
|
||||
/* __GDPR__
|
||||
"editorActionInvoked" : {
|
||||
"name" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"id": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"${include}": [
|
||||
"${EditorTelemetryData}"
|
||||
]
|
||||
}
|
||||
*/
|
||||
accessor.get(ITelemetryService).publicLog('editorActionInvoked', { name: this.label, id: this.id, ...editor.getTelemetryData() });
|
||||
type EditorActionInvokedClassification = {
|
||||
name: { classification: 'SystemMetaData', purpose: 'FeatureInsight' };
|
||||
id: { classification: 'SystemMetaData', purpose: 'FeatureInsight' };
|
||||
};
|
||||
type EditorActionInvokedEvent = {
|
||||
name: string;
|
||||
id: string;
|
||||
};
|
||||
accessor.get(ITelemetryService).publicLog2<EditorActionInvokedEvent, EditorActionInvokedClassification>('editorActionInvoked', { name: this.label, id: this.id });
|
||||
}
|
||||
|
||||
public abstract run(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void | Promise<void>;
|
||||
|
||||
Reference in New Issue
Block a user