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

I most often get no useful completion - in my big project. #43

Open
Ploppz opened this issue Jul 16, 2016 · 11 comments
Open

I most often get no useful completion - in my big project. #43

Ploppz opened this issue Jul 16, 2016 · 11 comments

Comments

@Ploppz
Copy link

Ploppz commented Jul 16, 2016

Problems summary

Using deoplete / deoplete-clang, writing C++, I often get only weak completion (just a list of could-be-useful words/predictions). For example in this function, why don't I get completion on std::deque?
screenshot

Another case:
The class has a member SAP<int>& broadphase_alg; with several public members and methods. But again I only get useless information: screenshot

Expected

Proper completion.

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!)

" Deoplete
let g:deoplete#enable_at_startup = 1
let g:deoplete#sources#clang#libclang_path = '/usr/lib/libclang.so'
let g:deoplete#sources#clang#clang_header = '/usr/lib/clang'
let g:deoplete#sources#clang#std#cpp = 'c++11'


syntax enable
filetype plugin indent on

let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1

" Files
set backup
set backupdir=~/.local/share/nvim/backup
set directory=~/.local/share/nvim/swap
set undofile
set undodir=~/.local/share/nvim/undo
" Basic configuration
set expandtab
set shiftwidth=4
set tabstop=4
set softtabstop=4
set clipboard+=unnamedplus
set showcmd
set number
set scrolloff=15
set hlsearch
set cursorline
set nocompatible
set esckeys

autocmd BufNewFile, BufRead *.c++ setfiletype cpp

The reproduce ways from neovim starting (Required!)

I would have to share all the code of my project. I tried making a minimal test case but in the test case it all works... it's only in my big project deoplete-clang seldomly works.

Generate a logfile if appropriate

http://sprunge.us/EWVG

I guess I have some things missing, but I just couldn't reproduce the errors with a minimal test case. I really hope you can help me. I've been struggling a long time to write this issue (finding any pattern in the problems, finding a minimal test case...). Please ask me if there's anything more you need to know. Maybe I've overlooked something really basic.

@zchee
Copy link
Member

zchee commented Jul 16, 2016

@Ploppz Thanks issue.

I will debug it later.
but, I want to real(reproducible) C++ file. Could you post a sample .c++(.cc?) file?

@Ploppz
Copy link
Author

Ploppz commented Jul 16, 2016

completion-test.zip
here, it's a subset of my project that is almost independent. On for example line 80 in PairOrderer.c++, try writing broadphase_alg. - or any other member. Nothing works here. You see on lines 2-4 I had to exclude some files that this file depends on (else probably my whole project would have to be included). So it's not all syntactically correct in this 'minimal' test case. Don't know if that matters. It has the very same behaviour in my real project though, and everything compiles fine there.

Bonus question: I'm curious: When does deoplete-clang update the tags / whatever info it needs about members, classes, functions etc.? Only when you start vim?

@zchee
Copy link
Member

zchee commented Jul 16, 2016

@Ploppz Thanks example :) and understood your said meaning.

Bonus question: I'm curious: When does deoplete-clang update the tags / whatever info it needs about members, classes, functions etc.? Only when you start vim?

It meaning of, When does deoplete-clang get the AST information of the current buffer?

@Ploppz
Copy link
Author

Ploppz commented Jul 16, 2016

Yeah, that's probably what I mean. I can best explain with a practical example: if I have just written a class and started to use it, can I expect completion on instances of the class immediately, or do I have to restart vim or something else? Another question, maybe related: Does deoplete/deoplete-clang keep state? - my CPU gets quite busy for maybe 10 sec, every time I stop at a . or -> sign.

@zchee
Copy link
Member

zchee commented Jul 16, 2016

@Ploppz got it.
I will explain that question with

Another question

:)

@Shougo
Copy link
Collaborator

Shougo commented Jul 17, 2016

Reproduced.
It seems bug...

@Shougo
Copy link
Collaborator

Shougo commented Jul 17, 2016

I have tested it in vim-marching.
But it is same result. I think clang does not support the feature...

https://github.com/osyo-manga/vim-marching

@Shougo
Copy link
Collaborator

Shougo commented Jul 17, 2016

@Ploppz Please test it using YouCompleteMe.

@Shougo
Copy link
Collaborator

Shougo commented Jul 27, 2016

@Ploppz Please upload your clang version.
I think your clang version is 3.8+.
Because, I cannot reproduce it in clang 3.4.
But I can reproduce it in clang 3.8.
Current libclang within deoplete-clang supports clang 3.6 instead of 3.8.
Yes, the libclang must support clang 3.8.
Upstream libclang already supports clang 3.8.

@Ploppz
Copy link
Author

Ploppz commented Jul 27, 2016

Sorry I didn't get around to testing either issues yet. I do have clang version 3.8. Will deoplete-clang support clang 3.8 in the near future or do I have to downgrade clang? Or is there another solution?

@Shougo
Copy link
Collaborator

Shougo commented Jul 28, 2016

Will deoplete-clang support clang 3.8 in the near future or do I have to downgrade clang?

It should be. But it is @zchee 's work. I cannot support it.

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

3 participants