roxma / ncm-clang

DEPRECATED use https://github.com/ncm2/ncm2-pyclang instead
29 stars 4 forks source link

Can't find files in include path of compile-commands.json during completion #12

Open ho1messi opened 6 years ago

ho1messi commented 6 years ago

I have a compile_commans.json in my project's root path, but ncm-clang can not read it. As shown in these pictures, if it can find the include path, it can give the completion of testing, but it didn't. The project can be built, so the compiler can find the include file "gtest/gtest.h", so it should be ncm-clang didn't find the databash file. tim 20180621171303 tim 20180621171344

ho1messi commented 6 years ago

I found two problems here. The first one is when there are paths in compile_commands.json, ncm-clang will remove all the "\\" and which is auto generated by cmake when in windows.

I try to fix it myself, and when I changed here in ncm_clang.py it works.

The second problem is that cmake only generate a compile_commands.json with a includes_CXX.rsp file by default, but ncm-clang can not get the include paths from this file.

When getting the correct include paths, the plugin can just give the right completion.