RandomFractals / vscode-snippets-viewer

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

Create snippets webview #5

Open RandomFractals opened 3 years ago

RandomFractals commented 3 years ago
usernamehw commented 3 years ago

Is it a webview editor or webview view?

RandomFractals commented 3 years ago

It will be a webview to view snippets list by language or extension in tabular format.

The closest I could find was this extension: https://github.com/robole/vscode-snippets-ranger

I just don't like the TOC and nav for those snippet tables. So, it will be similar with snippets table listing snippets using prefix, body, name, and description column order and dropdowns for nav.

usernamehw commented 3 years ago

I don't like how body looks in that extension. Will body column have formatting and syntax highlighting?

RandomFractals commented 3 years ago

yep. I'll probably use this lib to make it pretty: https://highlightjs.org/

usernamehw commented 3 years ago

https://github.com/shikijs/shiki - This highlighter is based on vscode-textmate, so the highlighting is almost like native vscode one , but I'm not sure it can work in a webview (Although it kind of should: https://marketplace.visualstudio.com/items?itemName=bierner.markdown-shiki)

usernamehw commented 3 years ago

Actually, it probably wouldn't work. That extension uses shiki on extension side and provides syntax highlighting for markdown preview.

RandomFractals commented 3 years ago

I'll take a look. Thanks for the links.

Ideally, I would like to have snippet body formatted using vscode.MarkdownString, but I don't know how to wire that in webview yet :)