tweekmonster / deoplete-clang2

MIT License
90 stars 17 forks source link

Not getting clang completion immediately #17

Open ghost opened 7 years ago

ghost commented 7 years ago

Hi,

I am using this plugin for C/C++ programming and I think it is great, especially for the parameters placeholders that avoid the sometimes annoying switches between tabs to have a look at man.

However, I noticed that the translation is not immediate/automatic: let's say I want to type mmap (includes are there already). What happens is that I don't get the clang completion immediately but I have to type a space in the middle of the word then go back and continue typing. Only now the clang completion appears. This is quite annoying since I would like to get the completion in realtime.

Anyone having the same issue?

Currently using nvim 0.2.0, clang 4.0 (tested also with 3.4.2 and seen the same behavior) and latest deoplete and deoplete-clang2 sources.

My init.vim

let g:deoplete#enable_at_startup = 1
let g:deoplete#sources#clang#sort_algo = 'priority'
set completeopt-=preview

Thanks,

Christian

doubleloop commented 6 years ago

same issue here (debian, NVIM v0.2.1-944-g77f1392f0, clang version 3.8.1-24, latest deoplete/deoplete-clang2), any update?

aswinmohanme commented 6 years ago

Same Issue, on Fedora 26

arecarn commented 6 years ago

same issue: Ubuntu 16.04 NVIM v0.2.3-dev clang version 3.8.0-2

pull request #20 does appear to fix this

Shougo commented 6 years ago

Hi, I am deoplete author. I have reproduced the problem.

But you can configure it manually.

call deoplete#custom#source('clang2', 'min_pattern_length', 2)
Synray commented 6 years ago

Any fix for this issue? Using Arch linux with nvim 0.2.3, clang 6.0.0, latest deoplete & deoplete-clang2 (installed with vim-plug) I'm getting the same problem as OP. I don't immediately get completion from clang when I start typing a word. I've tried a few different configurations. Here's my default:

" deoplete
let g:deoplete#enable_at_startup = 1
" deoplete-clang                                                          
let g:deoplete#sources#clang#autofill_neomake = 1                         
let g:deoplete#sources#clang#executable = '/usr/bin/clang'                
let g:deoplete#sources#clang#clang_header = '/usr/lib/clang/6.0.0/include'

With the default config, clang completion only appears after typing 'space BS' or typing '.' or '->' . Member/struct completion works however.

When I test this with struct point {int x; int y;} point1;, as I start to type point1, no clang completion shows. When I type point1. it successfully shows point1's members as options.

When I add call deoplete#custom#source('clang2', 'min_pattern_length', 2) Testing the same structure, as I start to type point1, clang completion shows point1 as an option. But now when I type point1., there are no members shown as options anymore. I might look through the source for anything obvious but I'm not quite sure how to debug a plugin.

Shougo commented 6 years ago

You can use deoplete-clangx instead. https://github.com/Shougo/deoplete-clangx