You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
')"}
stack traceback:
[C]: in function 'vsnip#to_string'
...\site\pack\packer\start\cmp-vsnip/lua/cmp_vsnip/init.lua:40: in function 'resolve'
...-data\site\pack\packer\start\nvim-cmp/lua/cmp/source.lua:348: in function 'resolve'
...m-data\site\pack\packer\start\nvim-cmp/lua/cmp/entry.lua:452: in function 'resolve'
...im-data\site\pack\packer\start\nvim-cmp/lua/cmp/view.lua:225: in function 'fn'
...\site\pack\packer\start\nvim-cmp/lua/cmp/utils/async.lua:41: in function <...\site\pack\packer\start\nvim-cmp/lua/cmp/utils/async.lua:39>
Removing the '$' in the body array allows the snippet to expand without error. The snippet as is works in VSCode, so not sure if this is considered a bug or just a difference between VSCode snippets and this plugin. I suspect it is trying to expand the '$' and following characters as if it were a placeholder. Is there a way to escape the '$' in the meantime?
The text was updated successfully, but these errors were encountered:
{ # Works
documentation: 'if unset or null',
label: 'if-unset-or-null',
insertText: '"\\${${1:variable}:-${2:default}}"',
},
while others are not while-defined
{ # Does not work
label: 'while-defined',
documentation: 'while with variable existence check',
insertText: [
'while [[ -n "${${1:variable}+x}" ]]',
'\t${2:command ...}',
'done',
].join('\n'),
},
The effect of course is that only
while [[ -n "
Is returned, it breaks the snippet expansion completely as well as jumps.
I tested in (reference) vscode just to check, as well as ask my friend who uses coc-lsp (I use yegappan/lsp) how it behaved, but to my surprise, it worked.
These other clients must use some kind of magic interpretation of the tokens to conclude that the outer ${...+x} is not a placeholder, but actual text to be expanded - where vsnip assumes $ is placeholder due to lack of escaping and breaks
Still raises the question why the first snippet if-unset-or-null is properly escaped in that file.. it makes little sense to me, but I trust the bashls maintainers enough not to have overlooked it.
The presence of '$' in snippets seems to result in an error and does not expand:
The snippet causing this error:
Removing the '$' in the body array allows the snippet to expand without error. The snippet as is works in VSCode, so not sure if this is considered a bug or just a difference between VSCode snippets and this plugin. I suspect it is trying to expand the '$' and following characters as if it were a placeholder. Is there a way to escape the '$' in the meantime?
The text was updated successfully, but these errors were encountered: