Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deoplete-clang doesn't complete include content unless I reopen the file. #52

Open
XDXX opened this issue Aug 22, 2016 · 5 comments
Open

Comments

@XDXX
Copy link

XDXX commented Aug 22, 2016

Problems summary

I'm using the deoplete + deoplete-clang + neoinclude. When my file #include <limits.h> and
I typing INT it will not show any completion candidates. If I reopen that file and typing INT
it will show completion candidates like INT_MAX and INT_MIN.

Expected

Completing include content without reopen the code file.

Environment Information

  • OS: Arch Linux
  • Neovim version: 0.1.4

Provide a minimal init.vim with less than 50 lines and not plugin manager (Required!)

" Your minimal init.vim
set runtimepath+=~/path/to/deoplete.nvim/
set runtimepath+=~/path/to/deoplete-clang/
let g:deoplete#enable_at_startup = 1

" Use smartcase
let g:deoplete#enable_smart_case = 1

" Let <Tab> also do completion
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"

"close the preview window after completion is done.
autocmd CompleteDone * pclose!

" completion bracket
call deoplete#custom#set('_', 'converters', ['converter_auto_paren'])

" Deoplete-clang
let g:deoplete#sources#clang#libclang_path = '/usr/lib/libclang.so'
let g:deoplete#sources#clang#clang_header = '/usr/lib/clang'

The reproduce ways from neovim starting (Required!)

#include <limits.h>
INT   //will not show any completion candidates

save and reopen that file

#include <limits.h>
INT  //will show completion candidates like INT_MAX and INT_MIN

I'm not sure it's deoplete-clang or other plugin's problems.
Thanks for any help.

@Shougo
Copy link
Collaborator

Shougo commented Aug 22, 2016

I think the problem is...
#43 (comment)

@ghost
Copy link

ghost commented Jul 11, 2017

Hi there,

I am using neovim and freshest code for deoplete and deoplete-clang, and having the same problem. Completion from files included happens only after reopening the source file. This is happening regardless of the file included.

Does anyone have a clue? @XDXX have you solved the issue?

My setup

  • RedHat 7

  • Clang 3.4.2

  • NVIM v0.2.0

My init.vim (part of it)

let g:deoplete#enable_at_startup = 1                                                                                                           
let g:deoplete#sources#clang#libclang_path= '/usr/lib64/llvm/libclang.so'                         
let g:deoplete#sources#clang#clang_header = '/usr/lib/clang'                                                  
let g:deoplete#sources#clang#sort_algo = 'priority'                                                          
set completeopt-=preview`            

Thanks,
Christian

@XDXX
Copy link
Author

XDXX commented Jul 12, 2017

@christian-pinto This problem still bothers me and I don't have andy clue about it. Hope @zchee will fix this issue soon.

@Shougo
Copy link
Collaborator

Shougo commented Jul 12, 2017

deplete-clang2 exists. It has the same problem?

@ghost
Copy link

ghost commented Jul 12, 2017

I have just tested deoplete-clang2, it works with the includes. In previous post I forgot to mention that I am also using neoinclude.

However deoplete-clang2 has another problem for me that is translation is not always performed. As an example i write mmap, nothing appears, then I delete some characters and type again and the mmap autocompletion from clang appears. This is annoying since everytime i need to back and forth typing and deleting in order to get the autocompletion.

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

No branches or pull requests

2 participants