diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 3ac9aeb6..e680869a 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,6 +2,7 @@ // See http://go.microsoft.com/fwlink/?LinkId=827846 // for the documentation about the extensions.json format "recommendations": [ - "dbaeumer.vscode-eslint" + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode" ] } diff --git a/package-lock.json b/package-lock.json index 590ec723..ca7cb4f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-pets", - "version": "1.24.0", + "version": "1.25.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vscode-pets", - "version": "1.24.0", + "version": "1.25.0", "license": "MIT", "dependencies": { "@vscode/l10n": "^0.0.10" diff --git a/package.json b/package.json index 7b1bd459..db8b330f 100644 --- a/package.json +++ b/package.json @@ -29,18 +29,8 @@ "license": "MIT", "icon": "icon.png", "activationEvents": [ - "onCommand:vscode-pets.start", - "onCommand:vscode-pets.throw-with-mouse", - "onCommand:vscode-pets.throw-ball", - "onCommand:vscode-pets.spawn-pet", - "onCommand:vscode-pets.delete-pet", - "onCommand:vscode-pets.remove-all-pets", - "onCommand:vscode-pets.roll-call", - "onCommand:vscode-pets.export-pet-list", - "onCommand:vscode-pets.import-pet-list", "onWebviewPanel:petCoding", "onView:explorer", - "onView:petsView", "onStartupFinished" ], "main": "./out/extension/extension.js", diff --git a/src/extension/extension.ts b/src/extension/extension.ts index 061c42fc..75c2b435 100644 --- a/src/extension/extension.ts +++ b/src/extension/extension.ts @@ -85,6 +85,14 @@ function getThrowWithMouseConfiguration(): boolean { .get('throwBallWithMouse', true); } +function updateThrowWithMouseConfiguration() { + const config = vscode.workspace + .getConfiguration('vscode-pets'); + const newValue = !config.get('throwBallWithMouse', true); + config + .update('throwBallWithMouse', newValue, vscode.ConfigurationTarget.Global); +} + function updatePanelThrowWithMouse(): void { const panel = getPetPanel(); if (panel !== undefined) { @@ -365,6 +373,12 @@ export function activate(context: vscode.ExtensionContext) { }), ); + context.subscriptions.push( + vscode.commands.registerCommand('vscode-pets.throw-with-mouse', + updateThrowWithMouseConfiguration + ), + ); + context.subscriptions.push( vscode.commands.registerCommand('vscode-pets.delete-pet', async () => { const panel = getPetPanel(); @@ -855,9 +869,9 @@ class PetWebviewContainer implements IPetPanel { -->