neoclide / coc-snippets

Snippets solution for coc.nvim
968 stars 41 forks source link

vim-go func snippet causes errors #93

Closed piersy closed 3 years ago

piersy commented 4 years ago

The vim-go func snippet is causing an error when I try to expand it.

Minimal vimrc using vim-plug

call plug#begin()
Plug 'SirVer/ultisnips'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'fatih/vim-go'
call plug#end()

Minimal coc config

{
    "snippets.ultisnips.directories": [
        "UltiSnips",
        "gosnippets/UltiSnips"
    ]
}

Coc info

## versions

vim version: NVIM v0.4.3
node version: v12.2.0
coc.nvim version: 0.0.74-15f685206a
term: xterm-256color
platform: linux

## Messages

## Output channel: snippets

The competion popup menu before insertion coc-snippet-fail

The text inserted if I press enter

package main

func name(params)Traceback (most recent call last):  
File "<string>", line 3, in <module>
File "/tmp/coc-ultisnips-166c49187976bd49e3cfa0cbc473f03c.py", line 279, in opening_par
if return_values(t[pos]) > 1 and not t[pos].startswith("("):
IndexError: tuple index out of rangeTraceback (most recent call last):
File "<string>", line 3, in <module>
File "/tmp/coc-ultisnips-166c49187976bd49e3cfa0cbc473f03c.py", line 285, in closing_par
if return_values(t[pos]) > 1:
IndexError: tuple index out of range {

}
nicolas-martin commented 4 years ago

Also seeing the results on my end

image

chemzqm commented 3 years ago

Fixed on v2.2.6