vscode-docs icon indicating copy to clipboard operation
vscode-docs copied to clipboard

Document that you can contribute to the terminal view via view.title

Open Tyriar opened this issue 2 years ago • 4 comments

https://code.visualstudio.com/api/references/contribution-points#contributes.views

Part of https://github.com/microsoft/vscode/issues/79034, I just realized we've supported this for a long time via view.title:

"view/title": [
	{
	"command": "terminalTest.createTerminal",
	"when": "view == terminal",
	"group": "navigation"
	}
],

Image

Tyriar avatar Aug 09 '23 19:08 Tyriar

@sbatten @gregvanl I see contributes.menus points at contributes.views but doesn't give an example of "when": "view == someId", was this intentional or are we just missing this? Ideally we'd have a list of all the views in the docs so it's obvious what you can contribute to.

Tyriar avatar Aug 09 '23 19:08 Tyriar

@sandy081 originally did this I believe, but I don't think there is a list since this works for any view id.

sbatten avatar Aug 30 '23 16:08 sbatten

This seems to be mentioned in the tree view API doc here - https://code.visualstudio.com/api/extension-guides/tree-view - But it does not seems to explicit that one can contribute commands to any view. Probably this should be mentioned in menu contributions documentation?

sandy081 avatar Aug 31 '23 07:08 sandy081

@sandy081 thanks for the info! I'll mention it somewhere around menu contributions as I know users have wanted to add actions to the terminal for a while and I only discovered you could do so when adding other terminal menu contributions and realizing it didn't need one.

Tyriar avatar Aug 31 '23 14:08 Tyriar