deoplete-clang2 icon indicating copy to clipboard operation
deoplete-clang2 copied to clipboard

Not getting clang completion immediately

Open ghost opened this issue 7 years ago • 6 comments

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

ghost avatar Jul 13 '17 15:07 ghost

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

doubleloop avatar Oct 23 '17 11:10 doubleloop

Same Issue, on Fedora 26

aswinmohanme avatar Oct 28 '17 17:10 aswinmohanme

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

pull request #20 does appear to fix this

arecarn avatar Nov 22 '17 20:11 arecarn

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)

Shougo avatar Feb 08 '18 06:02 Shougo

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.

Synray avatar Apr 10 '18 20:04 Synray

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

Shougo avatar Apr 14 '18 07:04 Shougo