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

Add a setting to disable telemetry #14

Merged
merged 6 commits into from
Nov 5, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions README-PyPi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions schema/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,17 @@ const plugin: JupyterFrontEndPlugin<void> = {
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();
}
});
Expand Down
Loading