Home > Software engineering >  Can I show an image in a HoverProvider?
Can I show an image in a HoverProvider?

Time:06-02

I am new to vscode extension development so not sure best places to look for help. I want to hover over a word, and if that word matches the name in our icon directory, show a hover with that image. My first try was to use markdown to show the svg image from the web, but I believe that is not allowed for security that code could be executed. Can I show an svg in the markdown in a vscode.Hover? I can either include the svgs in the extension, or expect that the developer has already installed the npm package with the files into the workspace.

CodePudding user response:

There's only very limited Markdown support in hover items and images are not supported there at all, as far as I know.

CodePudding user response:

There is actually quite rich support for content and styling in MarkdownString in hovers. But, you want svg's which I don't see as supported on the list, see add an image to a hover pop-up

  • Related