VSCode 1.3 has added support for adding commands to context menus. Is there a way to identify whether a file or folder is clicked to open the explorer context menu?
A write up about the feature is here. But basically:
- the when is the same as the keybindings-when and can use the same keys
- the when can use two new keys resourceScheme and resourceLangId which are available without an editor - think of the explorer context menu
- the when can be a boolean configuration value, e.g config.editor.lineNumbers
My menu:
"menus":{
"explorer/context": [
{
"when": "resourceLangId == sql",
"command": "extension.myCmd"
}
]