RandomFractals / vscode-snippets-viewer

Snippets viewer for VSCode
https://marketplace.visualstudio.com/items?itemName=RandomFractalsInc.snippets-viewer
GNU General Public License v3.0
8 stars 1 forks source link

Add scrollbar for large snippet tooltip #24

Closed ecool closed 3 years ago

ecool commented 3 years ago

image

Some snippets are very large and the tooltip extends to fill the screen. Maybe set a configurable setting for max tooltip height and add a scrollbar to it whenever it hits that size or is larger than the height of the screen.

Should be possible to do with setting overflow on the tooltip div and setting a max-height through a CSS style.

div {
    overflow-y: auto;
    max-height: 100%;
}

May need to do so for width as well with overflow: auto; and setting both max-height and max-width.

RandomFractals commented 3 years ago

We might have to log this in vscode repo since that snippet tree view uses TreeItem tooltip provided by vscode api.

Unless I find CSS class name used for setting that vscode tooltip, I will not be able to fix it with max width, height and overflow on my end.

ecool commented 3 years ago

I'm currently looking at a possible way to override/include a custom style into the MarkdownString.

ecool commented 3 years ago

Apparently, MarkdownString or however the tooltip is constructed and shown to the user ignores