smjonas / snippet-converter.nvim

Bundle snippets from multiple sources and convert them to your format of choice.
Mozilla Public License 2.0
174 stars 4 forks source link

Feature Request: Support for Sublime Text Snippets #24

Open Abhinav1217 opened 1 year ago

Abhinav1217 commented 1 year ago

Is it possible to support sublime text's .sublime-snippet format. It is basically an XML document with some tags that define the properties of the snippets, (keyboard trigger, scope, language, etc) and a <content><~[CDATA[ ... ]]></content> block which contains actual snipptes.

I can contribute if you could point me to right direction. My exposure for lua is limited to neovim config and conky config, but I can manage my way around with some guidance.

smjonas commented 1 year ago

Great feature request! If you'd like to contribute, have a look at the existing code for the vsnip parser here. Basically, since sublime snippet contents use the same format as VSCode snippets we can reuse the existing body_parser.

What you'd need to do are the following things:

It's fine if you decide to only start with a few of these things - offering to help out is always appreciated! Let me know if you have any questions at any time.

Abhinav1217 commented 1 year ago

Thanks for the pointer.

I will give it a go this weekend. If it is something beyond my scope, I will let you know so that you can assign someone else on this.

krishpy99 commented 1 month ago

@smjonas I am a beginner to lua so I don't think I would be able to do this to completion by myself, however really interested in knowing if there is any progress on this issue.

edit: if you have very basic snippets that need to be converted checkout krishpy99.pythonanywhere.com, the work is also open-source (https://github.com/krishpy99/snippet-convert) however it is very primitive and I did it only because I was a little lazy to manually convert all of it.