Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

completions appearing only after sourcing vimrc twice #14

Open
dhananjayraut opened this issue Jul 11, 2021 · 4 comments
Open

completions appearing only after sourcing vimrc twice #14

dhananjayraut opened this issue Jul 11, 2021 · 4 comments

Comments

@dhananjayraut
Copy link

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:

@vigoux
Copy link
Member

vigoux commented Aug 2, 2021

Hi, I am not sure the issue comes from here, did you try with any other source ?

@dhananjayraut
Copy link
Author

dhananjayraut commented Aug 2, 2021

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?

@dhananjayraut
Copy link
Author

dhananjayraut commented Aug 2, 2021

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.

@vigoux
Copy link
Member

vigoux commented Aug 3, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants