neoclide / coc-vetur

Vue language server extension for coc.nvim
219 stars 7 forks source link

How can I automatically import components? #59

Closed C-alcium closed 3 years ago

C-alcium commented 3 years ago

Description of the problem In a simple project, how can I automatically insert the import for a component that coc-vetur is auto-completing for me?

Take this example in a default vue project created with vue cli create: image

All relevant CoC/vue related configuration in my init.vim

let g:coc_global_extensions = [ 'coc-vetur']
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')

let g:LanguageClient_serverCommands = {
    \ 'vue': ['vls']
    \ }

I'm certain that this is just me being silly in some way, hopefully I included enough detail, I can see that VLS is working I just can't get it to automatically insert the import...

C-alcium commented 3 years ago

It seemed to fix itself after I reinstalled everything. Now when I tab down to the option and press the right arrow key it auto-inserts it, in case anyone else has the same dumb issue as me.