draivin / hsnips

HyperSnips: a powerful snippet engine for VS Code, inspired by vim's UltiSnips
MIT License
154 stars 25 forks source link

Hsnips broken with recent VSCode update #155

Closed oiiiiiiii closed 1 year ago

oiiiiiiii commented 1 year ago

I believe the extension is somewhat broken with one of the more recent VSCode updates. I can no longer read tabstops properly. I disabled all other extensions but the problem is still there. E.g. I have this snippet.

snippet asdf "inline Math" iA
$1 $2 ``
console.log(t);
``$3
endsnippet

snippet

When I type ak[Tab]k[tab]l I get this console output in the developer console:

output

As you can see the content of the first tabstop is still accessible, but the second is not inserted in the t-array and when typing something in the last, an exception occurs. The exception is also thrown when I use $3 instead of $0.

oiiiiiiii commented 1 year ago

Sometimes it does work however. I have no idea why it sometimes works as expected and sometimes not

oiiiiiiii commented 1 year ago

I figured it out now: When the suggestion menu is visible when pressing tab to switch between tabstops this bug occurs

oiiiiiiii commented 1 year ago

Can be solved by doing the following: remove && !suggestWidgetVisible from the when clause context of the keyboard shortcut for hsnips.nextPlaceholder. Maybe it is also just some user specific setup that causes this behavior for me. But I also don't understand why the next tabstop is reaced if the when-clause-context should prevent it in that case