completion-treesitter
completion-treesitter copied to clipboard
completions appearing only after sourcing vimrc twice
when using this plugin as a completion source completions do not appear as soon as I open a file but rather I have to source my $VIMRC again for them to work as expected.
small init.vim to reproduce:
call plug#begin(stdpath('data') . '/plugged')
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-treesitter/completion-treesitter'
Plug 'nvim-lua/completion-nvim'
call plug#end()
set completeopt=menuone,noinsert,noselect
let g:completion_enable_auto_popup = 1
let g:completion_chain_complete_list = {
\ 'default': {
\ 'default': [
\ {'complete_items': ['ts']}],
\ }
\ }
autocmd BufEnter * lua require'completion'.on_attach()
after installing plugin install cpp support using :TSInstall cpp
open testfile.cpp
void function_name()
{
int variable = 0;
return
}
demo:
Hi, I am not sure the issue comes from here, did you try with any other source ?
yes all the other sources listed in my init.vim work as expected as soon as I open a files, but the suggestions from completion-treesitter only appear after sourcing $VIMRC again.
do you see anything wrong with the sample init.vim I posted? does it work of for you as expected?
also now I notice that :checkhealth is giving an error (ERROR: ts is not a valid completion source (in filetype default)) but if do :checkhealth after sourcing my init.vim second time the error disappears.
after seeing the error I tried using ts as completion source only for specific filetype (e.g. cpp) but the behavior is same.
To be honest, I don't know.. completion-nvim is close to be deprecated now, as no development is done... If you'd like to solve this bug, feel free to create a PR, but I really don't have any solution.