-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
YouCompleteMe with eigen3, incorrect syntax highlighting #2965
Comments
I can't reproduce. I installed the Eigen library with Homebrew and used the following flags = [
'-isystem', '/usr/local/include/eigen3'
]
def FlagsForFile( filename ):
return { 'flags': flags } I got no errors from your test case. I see that your version of YCM is using Clang 5.0.0 while the current version is on Clang 6.0.0. Could you try with the latest version of YCM? You'll need to run again the |
I tried micbou's simple .ycm_extra_conf.py file and installing eigen again with homebrew and I still have the same incorrect syntax highlighting. |
Only difference between the configurations is the macOS version. I tried on 10.13. I am suspecting the Clang system headers on macOS 10.11 are not compatible with the Clang version downloaded by YCM (6.0.0). Are you still getting the errors if you build YCM with the ./install.py --clang-completer --system-libclang |
micbou, Thank you for this suggestion!! I finally have gotten rid of the false errors by installing ycm with the --system-libclang flag in addition to the --clang-completer flag! This solved my problem, now I have correct recognition of the Eigen library with YCM. This has closed the issue for me. Thanks! |
@dillon4287 I have the same problem, and I use clang 5.0.1 in Mac OSX 11.6. But when I recompile YCM with By the way, some of the identifier in the |
I'm not sure why an older version of clang would help. Is your .ycm_extra_conf.py file right? |
Except the last line, everything is the default configuration of the ycm_extra_conf.py An interesting phenomenon is, I have several times recognise the Eigen::MatrixXd, which means that I can use the function in the namespace. But a few seconds after, ycm raise the error. How strange!
This is The 'txt' file type error may be contributed from open log file in gvim, which has nothing to do with the true error |
I'm not sure if this would help but have you included in your .ycm_extra_conf.py the actual source code and include directory? I think the person to really help you is @micbou because I do not know enough. |
@VincentZhou98 Which version of macOS? What's the output of |
@micbou
Woo, it looks like ycm look into the apple clang include directory! And the error about Eigen::MatrixXd is |
Im at a loss as to why it isnt working for you. I would try to ask micbou |
I find when I include the These file may have conflict with |
Try building YCM with —system-libclang |
@puremourning You mean |
Yes. You need Apple clang for intrinsics on macOS. |
@puremourning Thanks. After using |
OSS libclangs are missing whatever special sauce Apple adds to make certain Xcode things work (like iOS) |
Issue Prelude
Please complete these steps and check these boxes (by putting an
x
insidethe brackets) before filing your issue:
[Frequently Asked Questions][faq] section.
about to report and couldn't find an answer to my problem. ([Example Google
search.][search])
vim --version
.:YcmDebugInfo
.the
:YcmToggleLogs
command.version) I am using.
my issue, including what I expected to happen and what actually happened.
of
install.py
(orcmake
/make
/ninja
) including its invocationthat any help I receive is a selfless, heartfelt gift of their free time. I
know I am not entitled to anything and will be polite and courteous.
actually perform all of these steps.
I cannot get the syntax highlighting to work well for the Eigen library. I know about the .ycm_extra_conf.py file, I have used it and updated it before. I have gotten it to work properly in other contexts.
My eigen headers are located in /usr/local/include/eigen3. I changed the .ycm_extra_conf.py file to include these headers, I have also used the .json compilation database to try and help.
I created a small test case to illustrate the error,
The syntax error says excess elements in scalar initializer. In my actual project I get this error and that Eigen::MatrixXd is not a structure or union, none of Eigen library seems to be recognized.
I have the .ycm_extra_conf.py file in the build directory of this project.
I only changed one part of the .ycm_extra_conf.py file to try and include eigen in this project.
There is no problem with this code, it compiles with CMake and runs without errors.
Note
I have seen this, #303, and the advice was to use '-isystem', '/usr/local/include/eigen3'. This does not do anything.
I am able to get my .ycm_extra_conf.py file to see my other headers in my include/ directory, but I am not able to get it to see eigen.
Diagnostic data
Output of
vim --version
Output of
YcmDebugInfo
OS version, distribution, etc.
OSX El Capitan
10.11.6
The text was updated successfully, but these errors were encountered: