|
4 | 4 | 'use strict'; |
5 | 5 |
|
6 | 6 | import { inject, injectable, multiInject, named, optional } from 'inversify'; |
7 | | -import { CodeLens, Range } from 'vscode'; |
| 7 | +import { CodeLens, env, Range, Uri } from 'vscode'; |
8 | 8 | import { ICommandNameArgumentTypeMapping } from '../../common/application/commands'; |
9 | 9 | import { ICommandManager, IDebugService, IDocumentManager } from '../../common/application/types'; |
10 | 10 | import { IDisposable, IOutputChannel } from '../../common/types'; |
11 | 11 | import { DataScience } from '../../common/utils/localize'; |
12 | | -import { captureTelemetry } from '../../telemetry'; |
| 12 | +import { captureTelemetry, sendTelemetryEvent } from '../../telemetry'; |
13 | 13 | import { Commands, JUPYTER_OUTPUT_CHANNEL, Telemetry } from '../constants'; |
14 | 14 | import { |
15 | 15 | ICodeWatcher, |
@@ -68,6 +68,7 @@ export class CommandRegistry implements IDisposable { |
68 | 68 | this.registerCommand(Commands.DebugCurrentCellPalette, this.debugCurrentCellFromCursor); |
69 | 69 | this.registerCommand(Commands.CreateNewNotebook, this.createNewNotebook); |
70 | 70 | this.registerCommand(Commands.ViewJupyterOutput, this.viewJupyterOutput); |
| 71 | + this.registerCommand(Commands.GatherQuality, this.reportGatherQuality); |
71 | 72 | if (this.commandListeners) { |
72 | 73 | this.commandListeners.forEach((listener: IDataScienceCommandListener) => { |
73 | 74 | listener.register(this.commandManager); |
@@ -344,4 +345,9 @@ export class CommandRegistry implements IDisposable { |
344 | 345 | // Ask our code lens provider to find the matching code watcher for the current document |
345 | 346 | return this.dataScienceCodeLensProvider.getCodeWatcher(activeEditor.document); |
346 | 347 | } |
| 348 | + |
| 349 | + private reportGatherQuality(val: string) { |
| 350 | + sendTelemetryEvent(Telemetry.GatherQualityReport, undefined, { result: val === 'no' ? 'no' : 'yes' }); |
| 351 | + env.openExternal(Uri.parse(`https://aka.ms/gathersurvey?succeed=${val}`)); |
| 352 | + } |
347 | 353 | } |
0 commit comments