girishji / vimcomplete

Async autocompletion for Vim.
MIT License
109 stars 3 forks source link

Error in Python completions #69

Closed chris414862 closed 1 month ago

chris414862 commented 1 month ago

I recently reinstalled vimcomplete (new computer) and I am getting the following error when I attempt almost any edit in a Python3 file:

Error detected while processing TextChangedI Autocommands for "<buffer=1>"..function <SNR>69_VimComplete[28]..<SNR>69_GetItems[17]..<lambda>37:
line    1:
E1013: Argument 1: type mismatch, expected dict<any> but got string

It seems to occur when a completion is being triggered. However, non-Python files seem to be working properly. I am using vim9.0 and I did not change my vimcomplete configurations. Here they are for reference:


let vcoptions = {
\   "completer": {"postfixClobber":1},
\   "buffer": {"enable": 1,"dup":0,  "priority": 10},
\   "dictionary": {"enable": 1, "dup":0, "priority": 9, "filetypes":["python"]},
\   "path": {"enable": 1, "dup":0, "priority": 12},
\   "lsp": { "enable": 0},
\   "omnifunc": { "enable": 1, "dup":0, "priority": 11, "filetypes": ['python', 'javascript']}
\}
autocmd VimEnter * call g:VimCompleteOptionsSet(vcoptions)
autocmd FileType python set dictionary=$HOME/.vim/data/python.dict
let g:vimcomplete_tab_enable = 1

Any idea what is going on? The plugin is basically unusable at the moment for me

chris414862 commented 1 month ago

I reinstalled vim with python3 support and it started working. Is python3 support listed as a requirement for this plugin?

girishji commented 1 month ago

python3 is not required for this plugin. What is happening is that you are using Vim's omnifunc in a python file. Vim uses your python installation for completion. There is a file vim91/autoload/python3complete.vim in your Vim distribution, which handles the completions. Open an issue on Vim github if you find anything wonky.