This issue is about the combo CMake and Qt on Windows but this does not mean that clang_complete works for me with other configurations. This is my only setup, because this is what I work with all the time.
Software I use
llvm 9 32bits (precompiled binaries downloaded from here as suggested by the wiki)
gvim 8.1 32bit version, in case that matters
python 3.7 also 32 bits (matches the python version that vim is built against)
Qt 5.13 32bits with MinGW 7.3
CMake 3.15
Here is my simple clang_complete config, in vimrc:
let g:clang_library_path='C:\dev\tools\llvm\llvm9_32\bin'
let g:clang_use_library = 1
Seeing the argument @CMakeFiles/MyApp.dir/includes_CXX.rsp, it seems that the includes are pulled from that file. Here is the content of the file includes_CXX.rsp:
It all looks straight and clean to me but I do not get any suggestion from clang_complete. For instance, typing app. or QApplication:: orstd:: triggers the display of the message-- User defined completion (^U^N^P) Pattern not found`.
So question 1:
Does clang_complete, or libclang understands the argument @CMakeFiles/MyApp.dir/includes_CXX.rsp in a compile_command.json g++ command?
If the answer is no, I already tried to manually replace this argument with the content of the rsp file with no better result.
Question 2:
Beside from trying do guess what is wrong in a setup, how do you investigate efficently?
Edit:
I got it working partially by manually copying the include instructions from the rsp file to a .clang_complete file like so:
It now provides suggestion for the Qt library. However this is far from being ideal due to the manual intervention required. Also it still does not work for the standard library.
Hello,
This issue is about the combo CMake and Qt on Windows but this does not mean that clang_complete works for me with other configurations. This is my only setup, because this is what I work with all the time.
Software I use
Here is my simple clang_complete config, in vimrc:
I created a CMake project for Qt:
and I asked CMake to export the compile commands. Here is what I get:
Seeing the argument
@CMakeFiles/MyApp.dir/includes_CXX.rsp
, it seems that the includes are pulled from that file. Here is the content of the fileincludes_CXX.rsp
:It all looks straight and clean to me but I do not get any suggestion from
clang_complete
. For instance, typingapp.
or QApplication::or
std::triggers the display of the message
-- User defined completion (^U^N^P) Pattern not found`.:set omnifunc?
returnsomnifunc=ClangComplete
:set completefunc?
returnscompletefunc=ClangComplete
So question 1: Does
clang_complete
, orlibclang
understands the argument@CMakeFiles/MyApp.dir/includes_CXX.rsp
in acompile_command.json
g++ command? If the answer is no, I already tried to manually replace this argument with the content of the rsp file with no better result.Question 2: Beside from trying do guess what is wrong in a setup, how do you investigate efficently?
Edit: I got it working partially by manually copying the include instructions from the rsp file to a
.clang_complete
file like so:It now provides suggestion for the Qt library. However this is far from being ideal due to the manual intervention required. Also it still does not work for the standard library.