0

I'm developing a VS Code extension and want to add a menu that appears when hovering over or clicking a status bar item, similar to how GitHub Copilot displays its menu (see screenshot): https://i.ibb.co/czFhx4H/Screenshot-2025-11-03-173031.png


What I Want to Achieve:

  • A status bar item that shows a context menu with checkboxes and action buttons when clicked/hovered
  • Menu items that can toggle settings (with visual checkbox indicators)
  • Action buttons (like "Snooze" in the picture)
  • The menu should appear directly below the status bar icon, not as a separate QuickPick dialog

I found this article, but the answer doesn't seem to support buttons or any interactive elements.

1 Answer 1

1

I'm not an expert here, but from what I see in https://code.visualstudio.com/api/references/vscode-api, it doesn't look to me like this functionality is available through the VS Code extension API.

If you look at what VS Code is doing internally to create the chat status bar item, (search this.statusbarService.addEntry, getEntryProps, and take a glance at ChatStatusDashboard), observe that IStatusBarEntryContainer.addEntry takes an IStatusbarEntry, which can have a tooltip property which is a TooltipContent | ITooltipWithCommands, where TooltipContent is string | IMarkdownString | HTMLElement | IManagedHoverTooltipMarkdownString | IManagedHoverTooltipHTMLElement. Compare with the documented extension API StatusBarItem type definition, whose tooltip member is of type string | MarkdownString (see also IExtensionStatusBarItemService.setOrUpdateEntry).

I suppose you could try to assign an HTMLElement or TooltipWithCmmands to the tooltip on what you get from createStatusBarItem, and see if the extension facilities of VS Code reject it or not. I kind of expect it to, but during my skimming of source code, didn't see anything that immediately shows that it would. If it rejects it, I'd suggest you to raise a feature request in the VS Code issue tracker to request this as a feature.

Sign up to request clarification or add additional context in comments.

3 Comments

If anyone reading this ends up raising an issue ticket like I suggested, please either comment here with the link to it, or notify me in it with "@starball5" and a link to this Stack Overflow post so I can update it.
Thanks for the detailed analysis! You've basically went over what I've tried so far. I tried both StatusBarItem with MarkdownString and LanguageStatusItem. StatusBarItem with MarkdownString is the closest work-around, but limited, while LanguageStatusItem is even more limited, no rich tooltip support. HTML support for MarkdownString only supports inline styling too, so you can't even work around it with CSS. I'll create a feature request to expose this functionality to tooltips and will link it here. Thanks again.
@AbdelrahmanAbdelaal out of curiosity, did you try assigning an HTMLElement to the tooltip property? (an aside: if you found this answer helpful, consider upvoting it. you don't have to, but you can)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.