xavierd / clang_complete

Vim plugin that use clang for completing C/C++ code.
http://www.vim.org/scripts/script.php?script_id=3302
1.96k stars 308 forks source link

Completion of class attribute fails unless I open and save the header file first #571

Closed ghosty141 closed 2 years ago

ghosty141 commented 5 years ago

In my header file I have the following line:

private:
    ClientClass client;

In the source file I have to following method:

#include "header.h"

void MyClass::init()
{
    client.setStuff(123);

When I now type "client.", I get the message "Pattern not found". After opening the header in a new buffer and saving it, the completion works totally fine and I get all the suggestions.

.vimrc configuration:

let g:clang_library_path='/Library/Developer/CommandLineTools/usr/lib/libclang.dylib'
set completeopt-=preview
let g:clang_user_options='-std=c++11'
let g:clang_jumpto_declaration_key='<F12>'
let g:clang_use_library=1

What am I missing?