reconquest / vim-pythonx

Python libraries for making coding in vim easier
27 stars 6 forks source link

Unknown function: go#util#Shellescape #15

Open edi9999 opened 2 years ago

edi9999 commented 2 years ago

I get following stacktrace when I open vim in a go file and in insert mode, write :

foo.

(After hitting the dot).


Error detected while processing function pythonx#autoimport[2]..provider#python3#Call:
line   18:
Error invoking 'python_execute' on channel 3 (python3-script-host):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/edgar/.vim/plugged/vim-pythonx/pythonx/px/langs/go/__init__.py", line 368, in autoimport_at_
cursor
    _DefaultAutoimporter.autoimport_at_cursor()
  File "/home/edgar/.vim/plugged/vim-pythonx/pythonx/px/langs/go/autoimport.py", line 127, in autoimport_a
t_cursor
    info = px.langs.go.gocode_get_info(identifier)
  File "/home/edgar/.vim/plugged/vim-pythonx/pythonx/px/langs/go/__init__.py", line 356, in gocode_get_inf
o
    info = vim.eval("px#go#get_info('"+identifier+"')")
  File "/home/edgar/.local/lib/python3.10/site-packages/pynvim/plugin/script_host.py", line 205, in eval
    obj = self.request("vim_eval", expr)
  File "/home/edgar/.local/lib/python3.10/site-packages/pynvim/api/nvim.py", line 182, in request
    res = self._session.request(name, *args, **kwargs)
  File "/home/edgar/.local/lib/python3.10/site-packages/pynvim/msgpack_rpc/session.py", line 102, in reque
st
    raise self.error_wrapper(err)
pynvim.api.common.NvimError: Vim(let):E117: Unknown function: go#util#Shellescape
Press ENTER or type command to continue
kovetskiy commented 2 years ago

This is probably because vim-go is updated and this function no longer exists there.

edi9999 commented 2 years ago

Indeed, it was removed here :

https://github.com/fatih/vim-go/commit/34aeb1ddfd436ef9781b0c6c44c7698c30232ea7

sanguis commented 2 years ago

you can do a temp fix for this by reverting vim-go.

git reset --hard d34c629b852cd4a308606791ca8a809cd8490886

kovetskiy commented 2 years ago

If you use plug.vim you can also use frozen tag: https://github.com/junegunn/vim-plug/blob/e300178a0e2fb04b56de8957281837f13ecf0b27/doc/plug.txt#L212

edi9999 commented 2 years ago

Thanks, I've fixed it using following line in my .vimrc :

Plug 'fatih/vim-go', { 'commit' : 'd34c629b852cd4a308606791ca8a809cd8490886' }
kovetskiy commented 2 years ago

Nice, ideally, this function can be moved to vim-pythonx. I am not sure anyone use vim-go nowadays, seems like everyone enjoys coc.nvim