girishji / vimcomplete

Async autocompletion for Vim.
MIT License
121 stars 5 forks source link

omnifunc complete does not work with syntaxcomplete#Complete #49

Closed phongnh closed 7 months ago

phongnh commented 7 months ago

Hi,

I just found that there is an issue when using omnifunc complete with syntaxcomplete#Complete. When opening Gemfile in Rails project, somehow this file's omnifunc is set to syntaxcomplete#Complete.

When typing gem ", everytime I type " I got this error:

image

Tried to check the source code, it looks the it is failed at autoload/vimcomplete/omnifunc.vim:44, but I don't know how to fix that.

Could you please help to fix this issue? Thanks.

girishji commented 7 months ago

My Vim automatically sets omnifunc for Gemfile to rubycomplete#Complete. Maybe try unsetting it in your .vimrc and let Vim set it.

Also, I cannot reproduce the problem with syntaxcomplete#Complete

Disable Lsp.

phongnh commented 7 months ago

My Vim automatically sets omnifunc for Gemfile to rubycomplete#Complete. Maybe try unsetting it in your .vimrc and let Vim set it.

Also, I cannot reproduce the problem with syntaxcomplete#Complete

Disable Lsp.

Tried to set its omnifunc to rubycomplete#Complete, it works fine. I did not use Lsp by the way. Thanks.

It seems that syntaxcomplete#Complete also does not work with other completion plugins. Previously, I tried to set this in my vimrc

" after/ftplugin/ruby.vim
if exists('&omnifunc') && &omnifunc ==# 'syntaxcomplete#Complete'
    setlocal omnifunc=
endif

I removed it recently :). Just added it back just in case.

Thanks for your support.