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

Create snippet from selection #62

Open usernamehw opened 3 years ago

usernamehw commented 3 years ago

Similar to Snippets View

https://github.com/usernamehw/vscode-snippets-view/blob/master/src/snippetFromSelection.ts

Not very important. There are might be extensions that do it better (write to file automatically instead of just giving an escaped json)

RandomFractals commented 3 years ago

Good idea. Let's keep this open for our wish list. Some ideas for how to go about it:

We can create or add to [language].json snippets in your workspace by default using active editor language id and code block selection.

Then on workspace or project scoped snippet files already loaded in #46, we can add snippet file context menu to move those snippets to [language].json snippets def. in User/snippets to promote them for global user snippets setup. Similarly we can add that option for project scoped snippet tree item.

RandomFractals commented 3 years ago

def. will need to add this feature to be able to create vscode ext. snippets from good extensions for https://github.com/RandomFractals/vscode-extension-snippets/issues/5