microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.62k stars 29.42k forks source link

StatusBarItem - add support for specifying a list of commands in the hover #234339

Open lszomoru opened 1 day ago

lszomoru commented 1 day ago

It would be nice if extensions would be able to specify a list of commands which would then be passed on to the HoverService so that they are rendered in the hover status bar.

bpasero commented 1 day ago

This needs to set the related actions options when creating the hover:

https://github.com/microsoft/vscode/blob/fc03f2bf3d5041009ad246efbf6973922f65728f/src/vs/workbench/browser/parts/statusbar/statusbarItem.ts#L123

https://github.com/microsoft/vscode/blob/fc03f2bf3d5041009ad246efbf6973922f65728f/src/vs/base/browser/ui/hover/hover.ts#L187

I would think this could be proposed new API for the status bar item to have an overload for tooltip:

https://github.com/microsoft/vscode/blob/fc03f2bf3d5041009ad246efbf6973922f65728f/src/vscode-dts/vscode.d.ts#L7229

Something like:

tooltip: string | MarkdownString | { actions: Command[], content: string | MarkDownString } | undefined

If someone wants to contribute this, opening for help wanted 👍