Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Includes collapseUnchangedRegions in diffEditor.editorVisibleTime telemetry event #191372

Merged
merged 1 commit into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {

private readonly movedBlocksLinesPart = observableValue<MovedBlocksLinesPart | undefined>('MovedBlocksLinesPart', undefined);

public get collapseUnchangedRegions() { return this._options.collapseUnchangedRegions.get(); }

constructor(
private readonly _domElement: HTMLElement,
options: Readonly<IDiffEditorConstructionOptions>,
Expand Down
7 changes: 7 additions & 0 deletions src/vs/workbench/browser/parts/editor/textDiffEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,17 +332,24 @@ export class TextDiffEditor extends AbstractTextEditor<IDiffEditorViewState> imp
}

private logInputLifecycleTelemetry(duration: number, languageId: string | undefined): void {
let collapseUnchangedRegions = false;
if (this.diffEditorControl instanceof DiffEditorWidget2) {
collapseUnchangedRegions = this.diffEditorControl.collapseUnchangedRegions;
}
this.telemetryService.publicLog2<{
editorVisibleTimeMs: number;
languageId: string;
collapseUnchangedRegions: boolean;
}, {
owner: 'hediet';
editorVisibleTimeMs: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'Indicates the time the diff editor was visible to the user' };
languageId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates for which language the diff editor was shown' };
collapseUnchangedRegions: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Indicates whether unchanged regions were collapsed' };
comment: 'This event gives insight about how long the diff editor was visible to the user.';
}>('diffEditor.editorVisibleTime', {
editorVisibleTimeMs: duration,
languageId: languageId ?? '',
collapseUnchangedRegions,
});
}

Expand Down