Closed smjonas closed 1 year ago
The reason why the snippets were not converted seems to be because the converter ignores visual placeholder nodes.
@flotisable This should now be fixed on the latest main. Your example is now converted to:
{
"if": {
"prefix": "if",
"description": "\"if control flow\"",
"body": [
"if ${1:<condition>}",
"\"",
"\t${2:$TM_SELECTED_TEXT}",
"\"",
"endif",
""
]
},
"ife": {
"prefix": "ife",
"description": "\"if else control flow\"",
"body": [
"if ${1:<condition>}",
"\"",
"\t$2",
"\"",
"else",
"\"",
"\t$3",
"\"",
"endif",
""
]
},
"func": {
"prefix": "func",
"description": "\"function definition\"",
"body": [
"function ${1:<function name>}(${2:<arguments>})",
"\"",
"\t${3:$TM_SELECTED_TEXT}",
"\"",
"endfunction",
""
]
}
}
The fix resolve the issue in the example. However, it seems the fix breaks a lot of snippet conversion. The example below works as expected before
after the fix, it is only converted to the snippet below, note the
if
andfunc
snippet disappearIf you would like to see more detail, my snippets can be found at https://github.com/flotisable/FlotisableVimSnippets. Clone the repo, and update the snippet-converter.nvim submodule, then run
make convert
. The converted difference between previous version and the fix can then be seen withgit diff
Originally posted by @flotisable in https://github.com/smjonas/snippet-converter.nvim/issues/16#issuecomment-1374965251