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

Toggle Slider for Throwing the Ball with the Mouse. Fix for #375 #399

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
12 changes: 1 addition & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,8 @@
"license": "MIT",
"icon": "icon.png",
"activationEvents": [
"onCommand:vscode-pets.start",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be remove as VS Code generates them automatically from the package.json contribution declarations

"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",
Expand Down Expand Up @@ -85,7 +75,7 @@
"icon": "media/dog.svg"
},
{
"command": "vscode-pets.throw-with-mouse",
"command": "vscode-pets.throwBallWithMouse",
"title": "Throw ball with mouse",
"category": "Pet Coding",
"icon": {
Expand Down
21 changes: 21 additions & 0 deletions src/extension/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,27 @@
}),
);

context.subscriptions.push(
vscode.commands.registerCommand(
'vscode-pets.throwBallWithMouse',
() => {
const config = vscode.workspace.getConfiguration('vscode-pets');
config.update(

Check warning on line 375 in src/extension/extension.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 375 in src/extension/extension.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
'throwBallWithMouse',
!getThrowWithMouseConfiguration(),
vscode.ConfigurationTarget.Global,
);

vscode.window.showInformationMessage(

Check warning on line 381 in src/extension/extension.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator

Check warning on line 381 in src/extension/extension.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
vscode.l10n.t(
'Throw ball with mouse is now {0}.',
getThrowWithMouseConfiguration() ? 'off' : 'on',
),
);
},
),
);

context.subscriptions.push(
vscode.commands.registerCommand('vscode-pets.delete-pet', async () => {
const panel = getPetPanel();
Expand Down
Loading