Closed kevin61416 closed 1 year ago
@chemzqm Still not works 🥲
For example,
s#!
works, but #!
not
You need to include !
to configuration "snippets.triggerCharacters"
for this case
I don't know whether the recent version update caused most of the UltiSnips to become ineffective and unable to load.
The output of CocCommand snippets.editSnippets
:
I don't know whether the recent version update caused most of the UltiSnips to become ineffective and unable to load. The output of
CocCommand snippets.editSnippets
Fixed on latest 3.1.8 version.
You need to include ! to configuration "snippets.triggerCharacters" for this case
Still does not work, also some snippets use regular expressions not work either, for example:
snippet /wh(ile)?/ "while ... (done)" rb
while ${2:[[ ${1:condition} ]]}; do
${0:${VISUAL}}
done
endsnippet
snippet /ift(est)?/ "if ... then (if)" rb
if ${2:[ ${1:condition} ]}; then
${0:${VISUAL}}
fi
endsnippet
Snippet with regex trigger are not included in completeion menu.
Note: python regex in snippet are converted to javascript regex, however, some regex patterns can't be supported by javascript, including
(?x)
(?s)
\Z
(?(id/name)yes-pattern|no-pattern)
.
Thank you for the explanation! However, I believe this is a straightforward and simple regex that's compatible with both POSIX and JS. Could you consider adding support for this kind of simple regex? I think it would be very helpful!
@chemzqm Still not works 🥲
For example,
s#!
works, but#!
not
There's bug
Fixed
Still not works 🥲, my coc-settings.json:
{
"snippets.triggerCharacters": ["!"]
}
Still not works 🥲, my coc-settings.json:
{ "snippets.triggerCharacters": ["!"] }
Should work when you type !
I've tried it, but it didn't work.
Snippets that start with English letters are all working properly.
vim version: VIM - Vi IMproved 9.0 9001850 node version: v18.17.0 coc.nvim version: 0.0.82-2a73b9dc 2023-09-21 23:24:13 +0800 coc.nvim directory: /Users/kevin/Workspace/dotfiles/.vim/plugged/coc.nvim term: iTerm.app platform: darwin
Issue 1: Identifying '#' in snippets
In the
c.snippets
file, I noticed that triggers starting with#
are not being recognized correctly in C files. For example,#ifndef
,#if
inc.snippets
both not works.Additionally, the
#v
snippet in mysh.snippets
file is also not being recognized. However, the only exception is the Shebang#!
, which is identified correctly.Figure 1 -
#if
only has LSP sources:Figure 2 - Other trigger words work fine:
Issue 2: Ineffective regular expression trigger words
Trigger words defined with regular expressions are not working as expected too. For instance, in the
sh.snippets
file of UltiSnips, the trigger word/wh(ile)?/
is recognized when I type 'wh', but 'while' does not trigger the snippet. Similarly, the trigger word/case|sw(itch)?/
is identified correctly with 'case' but not with 'sw' or 'switch'.Figure 3 -
wh
works well:Figure 4 -
while
not works:Environment:
I would greatly appreciate any guidance or solutions you can provide to resolve these issues. Please let me know if you need any further information.
Thank you!