diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 8d003f8..32f87f4 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -116,6 +116,11 @@ There are a few settings we recommend to edit in your user settings. 4. Keyboard shortcuts can be changed by searching for `completer` in the Keyboard Shortcuts settings and adding new shortcuts for the relevant commands. +5. Telemetry can be disabled by unchecking the `enableTelemetry` setting. + + > **NOTE**: The telemetry does not collect your code nor the suggested code completions. + > What is collected is whether a code suggestion was accepted or dismissed. + ## Troubleshooting If you are seeing the frontend extension, but it is not working, check that the server diff --git a/README-PyPi.md b/README-PyPi.md index 44646c4..96e0635 100644 --- a/README-PyPi.md +++ b/README-PyPi.md @@ -122,6 +122,11 @@ There are a few settings we recommend to edit in your user settings. 4. Keyboard shortcuts can be changed by searching for `completer` in the Keyboard Shortcuts settings and adding new shortcuts for the relevant commands. +5. Telemetry can be disabled by unchecking the `enableTelemetry` setting. + + > **NOTE**: The telemetry does not collect your code nor the suggested code completions. + > What is collected is whether a code suggestion was accepted or dismissed. + ## Terms of use - [End User License Agreement (EULA)](/~https://github.com/Qiskit/qiskit-code-assistant-jupyterlab/blob/main/docs/EULA.md) acceptance required before starting to use the model acceptance required before starting to use the model diff --git a/schema/plugin.json b/schema/plugin.json index d94c99b..b6400e2 100644 --- a/schema/plugin.json +++ b/schema/plugin.json @@ -26,6 +26,12 @@ "description": "Whether to fetch completions for QiskitCodeAssistant:completer", "type": "boolean", "default": true + }, + "enableTelemetry": { + "title": "Enable Telemetry", + "description": "Send telemetry to the Qiskit Code Assistant Service", + "type": "boolean", + "default": true } }, "additionalProperties": false diff --git a/src/index.ts b/src/index.ts index 93274bd..ea6dec4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -96,12 +96,17 @@ const plugin: JupyterFrontEndPlugin = { category: 'Qiskit Code Assistant' }); - completionProviderManager.selected.connect((completer, selection) => - provider.accept(selection.insertText) - ); + completionProviderManager.selected.connect((completer, selection) => { + if (settings.composite['enableTelemetry'] as boolean) { + provider.accept(selection.insertText); + } + }); app.commands.commandExecuted.connect((registry, executed) => { - if (executed.id === CommandIDs.acceptInline) { + if ( + executed.id === CommandIDs.acceptInline && + (settings.composite['enableTelemetry'] as boolean) + ) { inlineProvider.accept(); } });