contextValue
Context value of the tree item. This can be used to contribute item specific actions in the tree. For example, a tree item is given a context value as folder
. When contributing actions to view/item/context
using menus
extension point, you can specify context value for key viewItem
in when
expression like viewItem == folder
.
"contributes": {
"menus": {
"view/item/context": [
{
"command": "extension.deleteFolder",
"when": "viewItem == folder"
}
]
}
}
Content copied to clipboard
This will show action extension.deleteFolder
only for items with contextValue
is folder
.