If we do not already have we should list all the context keys used for commands across the workbench.
This wis espaciilay imporant for extension writers, however regular users also depend on this and people find it poorly documented.
A few things which are probably still undocumented:
[Actually documented] One can extend vscode.TreeItem like this:
class Item extends vscode.TreeItem {
contextValue = 'foo';
}
And then provide menu items to it, exclusively, with:
"when": "viewItem == foo"
One can also provide menu items only inside a particular view, like this:
"when": "view == myViewsExplorerID"
We do have https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts.
I'll update the list with the two view related clauses mentioned above.
@gregvanl I suggest you clone the vscode repository and do a full text search for rawContextKey to verify if some other are missing as well. And there are a lot of them missing imho
@isidorn When putting together the list, I tried to filter out contexts which were only for VS Code internal implementations that I didn't think an end user would need. The hope was to keep the list manageable. Perhaps for extenders, we do need a full list?
It would also be nice if we included when clauses in package.json and keybindings.json IntelliSense.
https://github.com/Microsoft/vscode/issues/9303
Most helpful comment
@gregvanl I suggest you clone the vscode repository and do a full text search for
rawContextKeyto verify if some other are missing as well. And there are a lot of them missing imho