Skip to content

Unable to get resourceFolder context keys to work #107725

@miguelsolorio

Description

@miguelsolorio

Testing #107638

I have this basic extension:

export function activate(context: vscode.ExtensionContext) {

	// notification
	const sayHello = vscode.commands.registerCommand('extension.helloWorld', () => {
		vscode.window.showInformationMessage('👋 Hello World!');
	});

	// commands
	vscode.commands.executeCommand('setContext', 'supportedFolders', ['test']);

	// context
	context.subscriptions.push(sayHello);
}

And also have the contribution set in the package.json like so:

		"menus": {
			"explorer/context": [
				{
					"command": "extension.helloWorld",
					"when": "explorerResourceIsFolder && resourceFolder in supportedFolders",
					"group": "navigation@1"
				}
			]
		}

And can't get the menu item to appear when right-clicking on a test folder, though if I remove the resourceFolder rule it'll show up so I'm wondering if I am either referencing it wrong here or if there is something else missing. I tried searching through our existing docs + issues and couldn't get much further.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions