vscode-api-playground icon indicating copy to clipboard operation
vscode-api-playground copied to clipboard

Command 'toggle' not found

Open mbrowne opened this issue 7 years ago • 9 comments

I tried to use this plugin by adding the following to keybindings.json:

{
	"key": "F4",
	"command": "toggle",
	"when": "editorTextFocus",
	"args": {
		"id": "autoReveal", // must be unique
		"overrideWorkspaceSettings": true,
		"values": [ // Note: use the same settings in each values object
			{
			  "explorer.autoReveal": true
			},
			{
			  "explorer.autoReveal": false
			}
		]
	}
}

...but it doesn't work. When I press F4, I get a warning: "command 'toggle' not found".

I'm on Visual Studio Code 1.13.1. There are no error messages in the console (even with settings.cycle.logLevel set to "log").

mbrowne avatar Jul 05 '17 18:07 mbrowne

@mbrowne and anyone else: the Option 2 from readme using two configs works.

lostdj avatar Sep 05 '17 13:09 lostdj

@mbrowne @lostdj Just played around with this and if you put "command": "settings.cycle" instead of "command": "toggle" it works! At least for me:)

problematik avatar Sep 20 '17 21:09 problematik

I'm not getting any toggling when using the keyboard short-cut ctrl+shift+p ?

{ 
    "key": "ctrl+shift+p",
    "command": "settings.cycle", 
    "when": "editorTextFocus",
    "args":{
        "id":"extenView",
        "value":[
            {
            "workbench.view.extensions":true
            },
            {
            "workbench.view.extensions":false
            }
        ]
    } 
}

SheepDomination avatar Apr 09 '18 23:04 SheepDomination

@mbrowne @lostdj Just played around with this and if you put "command": "settings.cycle" instead of "command": "toggle" it works! At least for me:)

Note you need the settings cycler extension to use settings.cycle.

ConorSheehan1 avatar Jun 11 '19 13:06 ConorSheehan1

The example just needs to be corrected on the Visual Studio Marketplace. Looks like the original example was copied from another extension "toggle" which the author references.

Really useful extension, but that almost threw me.

tigregalis avatar Jan 21 '20 12:01 tigregalis

Just came across this from Google. Issue is from 2017. but the readme on the marketplace is incorrect still, and the solution here for settings.cycle worked.

x029a avatar Oct 22 '20 22:10 x029a

For anyone else here, a restart of Visual Studio Code was also required to get this working.

spence avatar Dec 21 '20 00:12 spence

I'm here because of the examples in the book "Making VS Code Awesome".

Turns out I had to search for and install the "Toggle" extension -- the book said this but I didn't see it.

"command": "toggle" works now.

edit: I'm not using the tools in this repo, but this page came up on Google search for my issue. Leaving the comment in case it helps anyone else.

ab-gord avatar Jan 12 '22 19:01 ab-gord

You have to install Toggle extension. https://marketplace.visualstudio.com/items?itemName=rebornix.toggle

sajt avatar Jan 19 '24 21:01 sajt