Giter VIP home page Giter VIP logo

ccls's People

Contributors

acowley avatar agauniyal avatar amosbird avatar bstaletic avatar daandemeyer avatar danielmartin avatar edjubuh avatar federandink avatar firstlovelife avatar highcommander4 avatar jacobdufault avatar jacobdufault-google avatar jaelsasser avatar jamescookmd avatar jhasse avatar jiegec avatar jlahoda avatar khng300 avatar leszekswirski avatar maskray avatar pdavydov108 avatar pelmers avatar rianneogi avatar riatre avatar romix avatar sarcasm avatar scturtle avatar topisani avatar walter-erquinigo avatar yshui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ccls's Issues

How about using mygamma to improve code quality

https://mygamma.io/

Gamma is an intelligent software analytics platform that supports teams in building high quality software.

You can register for free and scan for 5 times every day up to 1 million code.

I use it to analyze ccls and get a high score(4.45/5) ๐Ÿ‘.

image

If you are interested in it, maybe you can use it. Cheers.

spelling range

Logic of getting spelling range at:

ccls/src/indexer.cc

Lines 571 to 578 in 99eacfd

SourceLocation Spell = SM.getSpellingLoc(Loc);
const FileEntry *FE;
Range loc;
#if LLVM_VERSION_MAJOR < 7
auto P = SM.getExpansionRange(Loc);
loc = FromCharRange(SM, Ctx->getLangOpts(), SourceRange(P.first, P.second));
LocFID = SM.getFileID(P.first);
FE = SM.getFileEntryForID(LocFID);

seems to be problematic?

$ ccls -test-index
[FAILED] index_tests/function_declaration_definition.cc (section index_tests/function_declaration_definition.cc)
--- /tmp/ccls.expected.L93dNJ   2018-07-16 16:46:27.499019422 +0800
+++ /tmp/ccls.actual.6ENwYH     2018-07-16 16:46:27.499019422 +0800
@@ -8,8 +8,8 @@
       "short_name": "foo",
       "kind": 12,
       "storage": 0,
-      "declarations": ["1:6-1:9|0|1|1"],
-      "spell": "3:6-3:9|0|1|2",
+      "declarations": ["1:6-1:6|0|1|1"],
+      "spell": "3:6-3:6|0|1|2",
       "extent": "3:1-3:14|0|1|0",
       "bases": [],
       "derived": [],

Logic at

ccls/src/indexer.cc

Lines 587 to 598 in 0c50ee7

SourceLocation Spell = SM.getSpellingLoc(Loc);
Loc = SM.getFileLoc(Loc);
Range loc = FromTokenRange(SM, Lang, SourceRange(Loc, Loc));
LocFID = SM.getFileID(Loc);
const FileEntry *FE = SM.getFileEntryForID(LocFID);
if (!FE) {
// TODO
#if LLVM_VERSION_MAJOR < 7
auto P = SM.getExpansionRange(Loc);
loc = FromCharRange(SM, Ctx->getLangOpts(), SourceRange(P.first, P.second));
LocFID = SM.getFileID(P.first);
FE = SM.getFileEntryForID(LocFID);
seems to be fine.

Multiple definition during the linking step

Hi, it's me again. There seems to be some problems of the final linking step:

$ VERBOSE=1 cmake --build release
[1/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/third_party/siphash.cc.obj -MF CMakeFiles\ccls.dir\third_party\siphash.cc.obj.d -o CMakeFiles/ccls.dir/third_party/siphash.cc.obj -c ../third_party/siphash.cc
[2/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/config.cc.obj -MF CMakeFiles\ccls.dir\src\config.cc.obj.d -o CMakeFiles/ccls.dir/src/config.cc.obj -c ../src/config.cc
[3/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/utils.cc.obj -MF CMakeFiles\ccls.dir\src\utils.cc.obj.d -o CMakeFiles/ccls.dir/src/utils.cc.obj -c ../src/utils.cc
[4/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/filesystem.cc.obj -MF CMakeFiles\ccls.dir\src\filesystem.cc.obj.d -o CMakeFiles/ccls.dir/src/filesystem.cc.obj -c ../src/filesystem.cc
[5/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/file_consumer.cc.obj -MF CMakeFiles\ccls.dir\src\file_consumer.cc.obj.d -o CMakeFiles/ccls.dir/src/file_consumer.cc.obj -c ../src/file_consumer.cc
[6/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/ccls_callers.cc.obj -MF CMakeFiles\ccls.dir\src\messages\ccls_callers.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/ccls_callers.cc.obj -c ../src/messages/ccls_callers.cc
[7/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/working_files.cc.obj -MF CMakeFiles\ccls.dir\src\working_files.cc.obj.d -o CMakeFiles/ccls.dir/src/working_files.cc.obj -c ../src/working_files.cc
[8/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/clang_tu.cc.obj -MF CMakeFiles\ccls.dir\src\clang_tu.cc.obj.d -o CMakeFiles/ccls.dir/src/clang_tu.cc.obj -c ../src/clang_tu.cc
[9/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/ccls_base.cc.obj -MF CMakeFiles\ccls.dir\src\messages\ccls_base.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/ccls_base.cc.obj -c ../src/messages/ccls_base.cc
[10/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/clang_utils.cc.obj -MF CMakeFiles\ccls.dir\src\clang_utils.cc.obj.d -o CMakeFiles/ccls.dir/src/clang_utils.cc.obj -c ../src/clang_utils.cc
[11/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/method.cc.obj -MF CMakeFiles\ccls.dir\src\method.cc.obj.d -o CMakeFiles/ccls.dir/src/method.cc.obj -c ../src/method.cc
[12/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/ccls_call_hierarchy.cc.obj -MF CMakeFiles\ccls.dir\src\messages\ccls_call_hierarchy.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/ccls_call_hierarchy.cc.obj -c ../src/messages/ccls_call_hierarchy.cc
[13/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/fuzzy_match.cc.obj -MF CMakeFiles\ccls.dir\src\fuzzy_match.cc.obj.d -o CMakeFiles/ccls.dir/src/fuzzy_match.cc.obj -c ../src/fuzzy_match.cc
[14/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/language.cc.obj -MF CMakeFiles\ccls.dir\src\language.cc.obj.d -o CMakeFiles/ccls.dir/src/language.cc.obj -c ../src/language.cc
[15/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/log.cc.obj -MF CMakeFiles\ccls.dir\src\log.cc.obj.d -o CMakeFiles/ccls.dir/src/log.cc.obj -c ../src/log.cc
[16/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/clang_complete.cc.obj -MF CMakeFiles\ccls.dir\src\clang_complete.cc.obj.d -o CMakeFiles/ccls.dir/src/clang_complete.cc.obj -c ../src/clang_complete.cc
[17/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/platform_win.cc.obj -MF CMakeFiles\ccls.dir\src\platform_win.cc.obj.d -o CMakeFiles/ccls.dir/src/platform_win.cc.obj -c ../src/platform_win.cc
[18/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/lsp.cc.obj -MF CMakeFiles\ccls.dir\src\lsp.cc.obj.d -o CMakeFiles/ccls.dir/src/lsp.cc.obj -c ../src/lsp.cc
[19/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/platform_posix.cc.obj -MF CMakeFiles\ccls.dir\src\platform_posix.cc.obj.d -o CMakeFiles/ccls.dir/src/platform_posix.cc.obj -c ../src/platform_posix.cc
[20/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/include_complete.cc.obj -MF CMakeFiles\ccls.dir\src\include_complete.cc.obj.d -o CMakeFiles/ccls.dir/src/include_complete.cc.obj -c ../src/include_complete.cc
[21/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/position.cc.obj -MF CMakeFiles\ccls.dir\src\position.cc.obj.d -o CMakeFiles/ccls.dir/src/position.cc.obj -c ../src/position.cc
[22/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/main.cc.obj -MF CMakeFiles\ccls.dir\src\main.cc.obj.d -o CMakeFiles/ccls.dir/src/main.cc.obj -c ../src/main.cc
[23/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/message_handler.cc.obj -MF CMakeFiles\ccls.dir\src\message_handler.cc.obj.d -o CMakeFiles/ccls.dir/src/message_handler.cc.obj -c ../src/message_handler.cc
[24/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/match.cc.obj -MF CMakeFiles\ccls.dir\src\match.cc.obj.d -o CMakeFiles/ccls.dir/src/match.cc.obj -c ../src/match.cc
[25/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/query_utils.cc.obj -MF CMakeFiles\ccls.dir\src\query_utils.cc.obj.d -o CMakeFiles/ccls.dir/src/query_utils.cc.obj -c ../src/query_utils.cc
[26/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/pipeline.cc.obj -MF CMakeFiles\ccls.dir\src\pipeline.cc.obj.d -o CMakeFiles/ccls.dir/src/pipeline.cc.obj -c ../src/pipeline.cc
[27/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/ccls_file_info.cc.obj -MF CMakeFiles\ccls.dir\src\messages\ccls_file_info.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/ccls_file_info.cc.obj -c ../src/messages/ccls_file_info.cc
[28/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/test.cc.obj -MF CMakeFiles\ccls.dir\src\test.cc.obj.d -o CMakeFiles/ccls.dir/src/test.cc.obj -c ../src/test.cc
[29/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/ccls_vars.cc.obj -MF CMakeFiles\ccls.dir\src\messages\ccls_vars.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/ccls_vars.cc.obj -c ../src/messages/ccls_vars.cc
[30/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/project.cc.obj -MF CMakeFiles\ccls.dir\src\project.cc.obj.d -o CMakeFiles/ccls.dir/src/project.cc.obj -c ../src/project.cc
[31/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/query.cc.obj -MF CMakeFiles\ccls.dir\src\query.cc.obj.d -o CMakeFiles/ccls.dir/src/query.cc.obj -c ../src/query.cc
[32/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/ccls_freshen_index.cc.obj -MF CMakeFiles\ccls.dir\src\messages\ccls_freshen_index.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/ccls_freshen_index.cc.obj -c ../src/messages/ccls_freshen_index.cc
[33/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/serializer.cc.obj -MF CMakeFiles\ccls.dir\src\serializer.cc.obj.d -o CMakeFiles/ccls.dir/src/serializer.cc.obj -c ../src/serializer.cc
[34/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/third_party_impl.cc.obj -MF CMakeFiles\ccls.dir\src\third_party_impl.cc.obj.d -o CMakeFiles/ccls.dir/src/third_party_impl.cc.obj -c ../src/third_party_impl.cc
[35/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/exit.cc.obj -MF CMakeFiles\ccls.dir\src\messages\exit.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/exit.cc.obj -c ../src/messages/exit.cc
[36/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/ccls_inheritance_hierarchy.cc.obj -MF CMakeFiles\ccls.dir\src\messages\ccls_inheritance_hierarchy.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/ccls_inheritance_hierarchy.cc.obj -c ../src/messages/ccls_inheritance_hierarchy.cc
[37/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/ccls_member_hierarchy.cc.obj -MF CMakeFiles\ccls.dir\src\messages\ccls_member_hierarchy.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/ccls_member_hierarchy.cc.obj -c ../src/messages/ccls_member_hierarchy.cc
[38/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/indexer.cc.obj -MF CMakeFiles\ccls.dir\src\indexer.cc.obj.d -o CMakeFiles/ccls.dir/src/indexer.cc.obj -c ../src/indexer.cc
[39/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/shutdown.cc.obj -MF CMakeFiles\ccls.dir\src\messages\shutdown.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/shutdown.cc.obj -c ../src/messages/shutdown.cc
[40/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/text_document_did_close.cc.obj -MF CMakeFiles\ccls.dir\src\messages\text_document_did_close.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/text_document_did_close.cc.obj -c ../src/messages/text_document_did_close.cc
[41/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/text_document_did_save.cc.obj -MF CMakeFiles\ccls.dir\src\messages\text_document_did_save.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/text_document_did_save.cc.obj -c ../src/messages/text_document_did_save.cc
[42/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/text_document_code_lens.cc.obj -MF CMakeFiles\ccls.dir\src\messages\text_document_code_lens.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/text_document_code_lens.cc.obj -c ../src/messages/text_document_code_lens.cc
[43/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/text_document_document_highlight.cc.obj -MF CMakeFiles\ccls.dir\src\messages\text_document_document_highlight.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/text_document_document_highlight.cc.obj -c ../src/messages/text_document_document_highlight.cc
[44/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/text_document_did_open.cc.obj -MF CMakeFiles\ccls.dir\src\messages\text_document_did_open.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/text_document_did_open.cc.obj -c ../src/messages/text_document_did_open.cc
[45/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/text_document_hover.cc.obj -MF CMakeFiles\ccls.dir\src\messages\text_document_hover.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/text_document_hover.cc.obj -c ../src/messages/text_document_hover.cc
[46/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/text_document_definition.cc.obj -MF CMakeFiles\ccls.dir\src\messages\text_document_definition.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/text_document_definition.cc.obj -c ../src/messages/text_document_definition.cc
[47/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/text_document_implementation.cc.obj -MF CMakeFiles\ccls.dir\src\messages\text_document_implementation.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/text_document_implementation.cc.obj -c ../src/messages/text_document_implementation.cc
[48/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/text_document_document_symbol.cc.obj -MF CMakeFiles\ccls.dir\src\messages\text_document_document_symbol.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/text_document_document_symbol.cc.obj -c ../src/messages/text_document_document_symbol.cc
[49/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/initialize.cc.obj -MF CMakeFiles\ccls.dir\src\messages\initialize.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/initialize.cc.obj -c ../src/messages/initialize.cc
[50/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/text_document_did_change.cc.obj -MF CMakeFiles\ccls.dir\src\messages\text_document_did_change.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/text_document_did_change.cc.obj -c ../src/messages/text_document_did_change.cc
[51/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/text_document_references.cc.obj -MF CMakeFiles\ccls.dir\src\messages\text_document_references.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/text_document_references.cc.obj -c ../src/messages/text_document_references.cc
[52/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/workspace_did_change_configuration.cc.obj -MF CMakeFiles\ccls.dir\src\messages\workspace_did_change_configuration.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/workspace_did_change_configuration.cc.obj -c ../src/messages/workspace_did_change_configuration.cc
[53/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/workspace_did_change_watched_files.cc.obj -MF CMakeFiles\ccls.dir\src\messages\workspace_did_change_watched_files.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/workspace_did_change_watched_files.cc.obj -c ../src/messages/workspace_did_change_watched_files.cc
[54/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/text_document_type_definition.cc.obj -MF CMakeFiles\ccls.dir\src\messages\text_document_type_definition.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/text_document_type_definition.cc.obj -c ../src/messages/text_document_type_definition.cc
[55/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/text_document_rename.cc.obj -MF CMakeFiles\ccls.dir\src\messages\text_document_rename.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/text_document_rename.cc.obj -c ../src/messages/text_document_rename.cc
[56/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/workspace_symbol.cc.obj -MF CMakeFiles\ccls.dir\src\messages\workspace_symbol.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/workspace_symbol.cc.obj -c ../src/messages/workspace_symbol.cc
[57/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/text_document_signature_help.cc.obj -MF CMakeFiles\ccls.dir\src\messages\text_document_signature_help.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/text_document_signature_help.cc.obj -c ../src/messages/text_document_signature_help.cc
[58/59] D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=R\"(D:\Programs\msys64\mingw64\lib\clang\6.0.0)\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/messages/text_document_completion.cc.obj -MF CMakeFiles\ccls.dir\src\messages\text_document_completion.cc.obj.d -o CMakeFiles/ccls.dir/src/messages/text_document_completion.cc.obj -c ../src/messages/text_document_completion.cc
[59/59] cmd.exe /C "cd . && D:\Programs\msys64\mingw64\bin\clang++.exe -O3 -DNDEBUG   CMakeFiles/ccls.dir/third_party/siphash.cc.obj CMakeFiles/ccls.dir/src/clang_complete.cc.obj CMakeFiles/ccls.dir/src/clang_tu.cc.obj CMakeFiles/ccls.dir/src/clang_utils.cc.obj CMakeFiles/ccls.dir/src/config.cc.obj CMakeFiles/ccls.dir/src/file_consumer.cc.obj CMakeFiles/ccls.dir/src/filesystem.cc.obj CMakeFiles/ccls.dir/src/fuzzy_match.cc.obj CMakeFiles/ccls.dir/src/main.cc.obj CMakeFiles/ccls.dir/src/include_complete.cc.obj CMakeFiles/ccls.dir/src/indexer.cc.obj CMakeFiles/ccls.dir/src/method.cc.obj CMakeFiles/ccls.dir/src/language.cc.obj CMakeFiles/ccls.dir/src/log.cc.obj CMakeFiles/ccls.dir/src/lsp.cc.obj CMakeFiles/ccls.dir/src/match.cc.obj CMakeFiles/ccls.dir/src/message_handler.cc.obj CMakeFiles/ccls.dir/src/pipeline.cc.obj CMakeFiles/ccls.dir/src/platform_posix.cc.obj CMakeFiles/ccls.dir/src/platform_win.cc.obj CMakeFiles/ccls.dir/src/position.cc.obj CMakeFiles/ccls.dir/src/project.cc.obj CMakeFiles/ccls.dir/src/query_utils.cc.obj CMakeFiles/ccls.dir/src/query.cc.obj CMakeFiles/ccls.dir/src/serializer.cc.obj CMakeFiles/ccls.dir/src/test.cc.obj CMakeFiles/ccls.dir/src/third_party_impl.cc.obj CMakeFiles/ccls.dir/src/utils.cc.obj CMakeFiles/ccls.dir/src/working_files.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_base.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_call_hierarchy.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_callers.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_file_info.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_freshen_index.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_inheritance_hierarchy.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_member_hierarchy.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_vars.cc.obj CMakeFiles/ccls.dir/src/messages/exit.cc.obj CMakeFiles/ccls.dir/src/messages/initialize.cc.obj CMakeFiles/ccls.dir/src/messages/shutdown.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_code_lens.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_completion.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_definition.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_did_change.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_did_close.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_did_open.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_did_save.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_document_highlight.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_document_symbol.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_hover.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_implementation.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_references.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_rename.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_signature_help.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_type_definition.cc.obj CMakeFiles/ccls.dir/src/messages/workspace_did_change_configuration.cc.obj CMakeFiles/ccls.dir/src/messages/workspace_did_change_watched_files.cc.obj CMakeFiles/ccls.dir/src/messages/workspace_symbol.cc.obj  -o ccls.exe -Wl,--major-image-version,0,--minor-image-version,0  D:/Programs/msys64/mingw64/lib/libclang.dll.a -Wl,-Bstatic -lclangFrontend -lclangSerialization -lclangAST -lclangLex -lclangDriver -lclangBasic -lLLVMBitReader -lLLVMOption -lLLVMProfileData -lLLVMCore -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle -lncurses -Wl,-Bdynamic -lz -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
FAILED: ccls.exe
cmd.exe /C "cd . && D:\Programs\msys64\mingw64\bin\clang++.exe -O3 -DNDEBUG   CMakeFiles/ccls.dir/third_party/siphash.cc.obj CMakeFiles/ccls.dir/src/clang_complete.cc.obj CMakeFiles/ccls.dir/src/clang_tu.cc.obj CMakeFiles/ccls.dir/src/clang_utils.cc.obj CMakeFiles/ccls.dir/src/config.cc.obj CMakeFiles/ccls.dir/src/file_consumer.cc.obj CMakeFiles/ccls.dir/src/filesystem.cc.obj CMakeFiles/ccls.dir/src/fuzzy_match.cc.obj CMakeFiles/ccls.dir/src/main.cc.obj CMakeFiles/ccls.dir/src/include_complete.cc.obj CMakeFiles/ccls.dir/src/indexer.cc.obj CMakeFiles/ccls.dir/src/method.cc.obj CMakeFiles/ccls.dir/src/language.cc.obj CMakeFiles/ccls.dir/src/log.cc.obj CMakeFiles/ccls.dir/src/lsp.cc.obj CMakeFiles/ccls.dir/src/match.cc.obj CMakeFiles/ccls.dir/src/message_handler.cc.obj CMakeFiles/ccls.dir/src/pipeline.cc.obj CMakeFiles/ccls.dir/src/platform_posix.cc.obj CMakeFiles/ccls.dir/src/platform_win.cc.obj CMakeFiles/ccls.dir/src/position.cc.obj CMakeFiles/ccls.dir/src/project.cc.obj CMakeFiles/ccls.dir/src/query_utils.cc.obj CMakeFiles/ccls.dir/src/query.cc.obj CMakeFiles/ccls.dir/src/serializer.cc.obj CMakeFiles/ccls.dir/src/test.cc.obj CMakeFiles/ccls.dir/src/third_party_impl.cc.obj CMakeFiles/ccls.dir/src/utils.cc.obj CMakeFiles/ccls.dir/src/working_files.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_base.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_call_hierarchy.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_callers.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_file_info.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_freshen_index.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_inheritance_hierarchy.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_member_hierarchy.cc.obj CMakeFiles/ccls.dir/src/messages/ccls_vars.cc.obj CMakeFiles/ccls.dir/src/messages/exit.cc.obj CMakeFiles/ccls.dir/src/messages/initialize.cc.obj CMakeFiles/ccls.dir/src/messages/shutdown.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_code_lens.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_completion.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_definition.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_did_change.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_did_close.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_did_open.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_did_save.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_document_highlight.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_document_symbol.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_hover.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_implementation.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_references.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_rename.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_signature_help.cc.obj CMakeFiles/ccls.dir/src/messages/text_document_type_definition.cc.obj CMakeFiles/ccls.dir/src/messages/workspace_did_change_configuration.cc.obj CMakeFiles/ccls.dir/src/messages/workspace_did_change_watched_files.cc.obj CMakeFiles/ccls.dir/src/messages/workspace_symbol.cc.obj  -o ccls.exe -Wl,--major-image-version,0,--minor-image-version,0  D:/Programs/msys64/mingw64/lib/libclang.dll.a -Wl,-Bstatic -lclangFrontend -lclangSerialization -lclangAST -lclangLex -lclangDriver -lclangBasic -lLLVMBitReader -lLLVMOption -lLLVMProfileData -lLLVMCore -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle -lncurses -Wl,-Bdynamic -lz -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
CMakeFiles/ccls.dir/src/file_consumer.cc.obj:(.text+0x830): multiple definition of `TLS wrapper function for g_thread_id'
CMakeFiles/ccls.dir/src/config.cc.obj:(.text+0x0): first defined here
CMakeFiles/ccls.dir/src/pipeline.cc.obj:(.text+0x5b50): multiple definition of `TLS wrapper function for g_thread_id'
CMakeFiles/ccls.dir/src/config.cc.obj:(.text+0x0): first defined here
CMakeFiles/ccls.dir/src/messages/initialize.cc.obj:(.text+0x2270): multiple definition of `TLS wrapper function for g_thread_id'
CMakeFiles/ccls.dir/src/config.cc.obj:(.text+0x0): first defined here
D:\Programs\msys64\mingw64\lib\libclangAST.a(DeclBase.cpp.obj):(.text$_ZN4llvm20BumpPtrAllocatorImplINS_15MallocAllocatorELy4096ELy4096EE8AllocateEyy[_ZN4llvm20BumpPtrAllocatorImplINS_15MallocAllocatorELy4096ELy4096EE8AllocateEyy]+0x0): multiple definition of `llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ull, 4096ull>::Allocate(unsigned long long, unsigned long long)'
CMakeFiles/ccls.dir/src/serializer.cc.obj:(.text[_ZN4llvm20BumpPtrAllocatorImplINS_15MallocAllocatorELy4096ELy4096EE8AllocateEyy]+0x0): first defined here
D:\Programs\msys64\mingw64\lib\libclangAST.a(MicrosoftMangle.cpp.obj):(.text$_ZNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE8_M_eraseEPSt13_Rb_tree_nodeIiE[_ZNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE8_M_eraseEPSt13_Rb_tree_nodeIiE]+0x0): multiple definition of `std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::_M_erase(std::_Rb_tree_node<int>*)'
CMakeFiles/ccls.dir/src/third_party_impl.cc.obj:(.text[_ZNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE8_M_eraseEPSt13_Rb_tree_nodeIiE]+0x0): first defined here
D:\Programs\msys64\mingw64\lib\libclangLex.a(ModuleMap.cpp.obj):(.text$_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_[_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_]+0x0): multiple definition of `void std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_realloc_insert<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
CMakeFiles/ccls.dir/src/clang_complete.cc.obj:(.text[_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_M_realloc_insertIJS5_EEEvN9__gnu_cxx17__normal_iteratorIPS5_S7_EEDpOT_]+0x0): first defined here
D:\Programs\msys64\mingw64\lib\libclangBasic.a(DiagnosticIDs.cpp.obj):(.text$_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_[_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_]+0x0): multiple definition of `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
CMakeFiles/ccls.dir/src/clang_tu.cc.obj:(.text[_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_]+0x0): first defined here
D:\Programs\msys64\mingw64\lib\libclangBasic.a(VirtualFileSystem.cpp.obj):(.text$_ZNSt19_Sp_counted_deleterIPN4llvm3sys2fs6detail12DirIterStateENSt12__shared_ptrIS4_LN9__gnu_cxx12_Lock_policyE2EE8_DeleterISaIS4_EEESB_LS8_2EE14_M_get_deleterERKSt9type_info[_ZNSt19_Sp_counted_deleterIPN4llvm3sys2fs6detail12DirIterStateENSt12__shared_ptrIS4_LN9__gnu_cxx12_Lock_policyE2EE8_DeleterISaIS4_EEESB_LS8_2EE14_M_get_deleterERKSt9type_info]+0x0): multiple definition of `std::_Sp_counted_deleter<llvm::sys::fs::detail::DirIterState*, std::__shared_ptr<llvm::sys::fs::detail::DirIterState, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<llvm::sys::fs::detail::DirIterState> >, std::allocator<llvm::sys::fs::detail::DirIterState>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)'
CMakeFiles/ccls.dir/src/filesystem.cc.obj:(.text[_ZNSt19_Sp_counted_deleterIPN4llvm3sys2fs6detail12DirIterStateENSt12__shared_ptrIS4_LN9__gnu_cxx12_Lock_policyE2EE8_DeleterISaIS4_EEESB_LS8_2EE14_M_get_deleterERKSt9type_info]+0x0): first defined here
D:\Programs\msys64\mingw64\lib\libclangBasic.a(VirtualFileSystem.cpp.obj):(.text$_ZNSt19_Sp_counted_deleterIPN4llvm3sys2fs6detail12DirIterStateENSt12__shared_ptrIS4_LN9__gnu_cxx12_Lock_policyE2EE8_DeleterISaIS4_EEESB_LS8_2EED0Ev[_ZNSt19_Sp_counted_deleterIPN4llvm3sys2fs6detail12DirIterStateENSt12__shared_ptrIS4_LN9__gnu_cxx12_Lock_policyE2EE8_DeleterISaIS4_EEESB_LS8_2EED0Ev]+0x0): multiple definition of `std::_Sp_counted_deleter<llvm::sys::fs::detail::DirIterState*, std::__shared_ptr<llvm::sys::fs::detail::DirIterState, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<llvm::sys::fs::detail::DirIterState> >, std::allocator<llvm::sys::fs::detail::DirIterState>, (__gnu_cxx::_Lock_policy)2>::~_Sp_counted_deleter()'
CMakeFiles/ccls.dir/src/filesystem.cc.obj:(.text[_ZNSt19_Sp_counted_deleterIPN4llvm3sys2fs6detail12DirIterStateENSt12__shared_ptrIS4_LN9__gnu_cxx12_Lock_policyE2EE8_DeleterISaIS4_EEESB_LS8_2EED0Ev]+0x0): first defined here
D:\Programs\msys64\mingw64\lib\libclangBasic.a(VirtualFileSystem.cpp.obj):(.text$_ZNSt19_Sp_counted_deleterIPN4llvm3sys2fs6detail12DirIterStateENSt12__shared_ptrIS4_LN9__gnu_cxx12_Lock_policyE2EE8_DeleterISaIS4_EEESB_LS8_2EE10_M_destroyEv[_ZNSt19_Sp_counted_deleterIPN4llvm3sys2fs6detail12DirIterStateENSt12__shared_ptrIS4_LN9__gnu_cxx12_Lock_policyE2EE8_DeleterISaIS4_EEESB_LS8_2EE10_M_destroyEv]+0x0): multiple definition of `std::_Sp_counted_deleter<llvm::sys::fs::detail::DirIterState*, std::__shared_ptr<llvm::sys::fs::detail::DirIterState, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<llvm::sys::fs::detail::DirIterState> >, std::allocator<llvm::sys::fs::detail::DirIterState>, (__gnu_cxx::_Lock_policy)2>::_M_destroy()'
CMakeFiles/ccls.dir/src/filesystem.cc.obj:(.text[_ZNSt19_Sp_counted_deleterIPN4llvm3sys2fs6detail12DirIterStateENSt12__shared_ptrIS4_LN9__gnu_cxx12_Lock_policyE2EE8_DeleterISaIS4_EEESB_LS8_2EE10_M_destroyEv]+0x0): first defined here
D:\Programs\msys64\mingw64\lib\libclangBasic.a(VirtualFileSystem.cpp.obj):(.text$_ZNSt19_Sp_counted_deleterIPN4llvm3sys2fs6detail12DirIterStateENSt12__shared_ptrIS4_LN9__gnu_cxx12_Lock_policyE2EE8_DeleterISaIS4_EEESB_LS8_2EE10_M_disposeEv[_ZNSt19_Sp_counted_deleterIPN4llvm3sys2fs6detail12DirIterStateENSt12__shared_ptrIS4_LN9__gnu_cxx12_Lock_policyE2EE8_DeleterISaIS4_EEESB_LS8_2EE10_M_disposeEv]+0x0): multiple definition of `std::_Sp_counted_deleter<llvm::sys::fs::detail::DirIterState*, std::__shared_ptr<llvm::sys::fs::detail::DirIterState, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<llvm::sys::fs::detail::DirIterState> >, std::allocator<llvm::sys::fs::detail::DirIterState>, (__gnu_cxx::_Lock_policy)2>::_M_dispose()'
CMakeFiles/ccls.dir/src/filesystem.cc.obj:(.text[_ZNSt19_Sp_counted_deleterIPN4llvm3sys2fs6detail12DirIterStateENSt12__shared_ptrIS4_LN9__gnu_cxx12_Lock_policyE2EE8_DeleterISaIS4_EEESB_LS8_2EE10_M_disposeEv]+0x0): first defined here
D:\Programs\msys64\mingw64\lib\libclangBasic.a(VirtualFileSystem.cpp.obj):(.rdata$_ZTVSt19_Sp_counted_deleterIPN4llvm3sys2fs6detail12DirIterStateENSt12__shared_ptrIS4_LN9__gnu_cxx12_Lock_policyE2EE8_DeleterISaIS4_EEESB_LS8_2EE[_ZTVSt19_Sp_counted_deleterIPN4llvm3sys2fs6detail12DirIterStateENSt12__shared_ptrIS4_LN9__gnu_cxx12_Lock_policyE2EE8_DeleterISaIS4_EEESB_LS8_2EE]+0x0): multiple definition of `vtable for std::_Sp_counted_deleter<llvm::sys::fs::detail::DirIterState*, std::__shared_ptr<llvm::sys::fs::detail::DirIterState, (__gnu_cxx::_Lock_policy)2>::_Deleter<std::allocator<llvm::sys::fs::detail::DirIterState> >, std::allocator<llvm::sys::fs::detail::DirIterState>, (__gnu_cxx::_Lock_policy)2>'
CMakeFiles/ccls.dir/src/filesystem.cc.obj:(.rdata[_ZTVSt19_Sp_counted_deleterIPN4llvm3sys2fs6detail12DirIterStateENSt12__shared_ptrIS4_LN9__gnu_cxx12_Lock_policyE2EE8_DeleterISaIS4_EEESB_LS8_2EE]+0x0): first defined here

Update (07/07/2018)
After I use -DUSE_SHARED_LLVM=on, the following multiple definitions disppeared:

D:\Programs\msys64\mingw64\lib\libLLVMCore.a(OptBisect.cpp.obj):(.text$_ZNK4llvm2cl15OptionValueCopyIiE7compareERKNS0_18GenericOptionValueE[_ZNK4llvm2cl15OptionValueCopyIiE7compareERKNS0_18GenericOptionValueE]+0x0): multiple definition of `llvm::cl::OptionValueCopy<int>::compare(llvm::cl::GenericOptionValue const&) const'
CMakeFiles/ccls.dir/src/main.cc.obj:(.text[_ZNK4llvm2cl15OptionValueCopyIiE7compareERKNS0_18GenericOptionValueE]+0x0): first defined here
D:\Programs\msys64\mingw64\lib\libLLVMCore.a(OptBisect.cpp.obj):(.rdata$_ZTVN4llvm2cl11OptionValueIiEE[_ZTVN4llvm2cl11OptionValueIiEE]+0x0): multiple definition of `vtable for llvm::cl::OptionValue<int>'
CMakeFiles/ccls.dir/src/main.cc.obj:(.rdata[_ZTVN4llvm2cl11OptionValueIiEE]+0x0): first defined here
D:\Programs\msys64\mingw64\lib\libLLVMCore.a(DIBuilder.cpp.obj):(.text$_ZNK4llvm2cl15OptionValueCopyIbE7compareERKNS0_18GenericOptionValueE[_ZNK4llvm2cl15OptionValueCopyIbE7compareERKNS0_18GenericOptionValueE]+0x0): multiple definition of `llvm::cl::OptionValueCopy<bool>::compare(llvm::cl::GenericOptionValue const&) const'
CMakeFiles/ccls.dir/src/main.cc.obj:(.text[_ZNK4llvm2cl15OptionValueCopyIbE7compareERKNS0_18GenericOptionValueE]+0x0): first defined here
D:\Programs\msys64\mingw64\lib\libLLVMCore.a(DIBuilder.cpp.obj):(.rdata$_ZTVN4llvm2cl11OptionValueIbEE[_ZTVN4llvm2cl11OptionValueIbEE]+0x0): multiple definition of `vtable for llvm::cl::OptionValue<bool>'
CMakeFiles/ccls.dir/src/main.cc.obj:(.rdata[_ZTVN4llvm2cl11OptionValueIbEE]+0x0): first defined here
D:\Programs\msys64\mingw64\lib\libLLVMSupport.a(CommandLine.cpp.obj):(.text$_ZNK4llvm2cl15OptionValueCopyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE7compareERKNS0_18GenericOptionValueE[_ZNK4llvm2cl15OptionValueCopyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE7compareERKNS0_18GenericOptionValueE]+0x0): multiple definition of `llvm::cl::OptionValueCopy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::compare(llvm::cl::GenericOptionValue const&) const'
CMakeFiles/ccls.dir/src/main.cc.obj:(.text[_ZNK4llvm2cl15OptionValueCopyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE7compareERKNS0_18GenericOptionValueE]+0x0): first defined here
D:\Programs\msys64\mingw64\lib\libLLVMSupport.a(CommandLine.cpp.obj):(.rdata$_ZTVN4llvm2cl15OptionValueCopyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE[_ZTVN4llvm2cl15OptionValueCopyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE]+0x0): multiple definition of `vtable for llvm::cl::OptionValueCopy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >'
CMakeFiles/ccls.dir/src/main.cc.obj:(.rdata[_ZTVN4llvm2cl15OptionValueCopyINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE]+0x0): first defined here

log ends with:

clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Can't find Clang::Clang with releases.llvm.org LLVM-6.0.1-win64.exe

I'm on Windows using g++ and tools from scoop. CMake fails finding the Clang library. I tried again with the MSVC tools and it failed there also.

$ cmake -H. -BRelease -G Ninja
-- The CXX compiler identification is GNU 8.1.0
-- Check for working CXX compiler: C:/QNX/scoop/apps/gcc/current/bin/c++.exe
-- Check for working CXX compiler: C:/QNX/scoop/apps/gcc/current/bin/c++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- Using downloaded Clang
-- Downloading Clang 6.0.1 (https://releases.llvm.org/6.0.1/LLVM-6.0.1-win64.exe) ...
-- 7-Zip found in PATH
-- Extracting downloaded Clang with 7-Zip ...
-- Could NOT find Clang (missing: Clang_LIBRARY LLVM_INCLUDE_DIR LLVM_BUILD_INCLUDE_DIR) (found suitable version "6.0.1", minimum required is "6.0.0")
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Configuring done
CMake Error at CMakeLists.txt:18 (add_executable):
Target "ccls" links to target "Clang::Clang" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?

Error occur during linking.

OS: Archlinux With testing on and all up to date
llvm packages and version:

local/clang-compiler-rt-svn 7.0.0svn_r334049-1 (llvm-toolchain-svn)
    The "compiler-rt" set of runtime libraries for Clang and LLVM
local/clang-svn 7.0.0svn_r334049-1 (llvm-toolchain-svn)
    C language family frontend for LLVM
local/clang-tools-extra-svn 7.0.0svn_r334049-1 (llvm-toolchain-svn)
    Standalone tools for Clang: syntax checking, formatting, refactoring, etc.
local/lib32-llvm-libs 6.0.0-1
    Low Level Virtual Machine (runtime library)(32-bit)
local/lld-svn 7.0.0svn_r334049-1 (llvm-toolchain-svn)
    A linker from the LLVM project
local/llvm-libs-svn 7.0.0svn_r334049-1 (llvm-toolchain-svn)
    The LLVM Compiler Infrastructure (runtime libraries)
local/llvm-svn 7.0.0svn_r334049-1 (llvm-toolchain-svn)
    The LLVM Compiler Infrastructure

When I installing ccls-git from aur, the error below occurred.

[100%] Linking CXX executable ccls
/usr/bin/ld: ๆ‰พไธๅˆฐ -lLLVM_LIBRARY-NOTFOUND
collect2: ้”™่ฏฏ๏ผšld ่ฟ”ๅ›ž 1
make[2]: *** [CMakeFiles/ccls.dir/build.make:964๏ผšccls] ้”™่ฏฏ 1
make[1]: *** [CMakeFiles/Makefile2:68๏ผšCMakeFiles/ccls.dir/all] ้”™่ฏฏ 2
make: *** [Makefile:130๏ผšall] ้”™่ฏฏ 2

I don't know what to do now. :(

clang_translation_unit.cc:103 libclang crashed

OS: Arch linux with testing on;
neovim version: 0.2.2-6
the ccls package is installed from aur (ccls-git).
Language client plug is already up to date.

I wrote a simplest C++ source file with a main function include std::cout << "hello" << std::endl, and it can't complete anything.

(   0.019s) [indexer2]clang_translation_unit.cc:103   
| libclang crashed for /home/zwindl/test/cpp/test/a.cc.
 Please try running the following, identify which flag causes the issue, and report a bug. 
ccls will then filter the flag for you  automatically:
 %clang /home/zwindl/test/cpp/test/a.cc -fsyntax-only

After I run that command, there's nothing appeared :(

cquery vs ccls

First of all congratulations for the great work on cquery and ccls.

I would like to ask what are the advantages of using ccls over cquery except the ones in Readme.
For example in the longterm?

Also i would like to ask if there will be better support in the emacs plugin for ccls compared to cquery?

What license may be used for this project

As the definition of OSS in Wikipedia

Open-source software (OSS) is a type of computer software whose source code is released under a license in which the copyright holder grants users the rights to study, change, and distribute the software to anyone and for any purpose.

And what license may be used for this project?

If you choose MIT License, you can just use sed to add license info on every source code file easily.

git clone https://github.com/MaskRay/ccls
cd ccls/src
sed -i '1i\/* Copyright (c) 2017-2018 MaskRay, <[email protected]>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n==============================================================================*\/\n' *.cc *.h
cd serializers
sed -i '1i\/* Copyright (c) 2017-2018 MaskRay, <[email protected]>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n==============================================================================*\/\n' *.h
cd ../messages
sed -i '1i\/* Copyright (c) 2017-2018 MaskRay, <[email protected]>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n==============================================================================*\/\n' *.cc

If you use other license, you can change sed command accordingly.

no document format buffer capabaility for ccls?

I tried using lsp-format-buffer inside emacs after configuring lsp-css and to my surprise, lsp-mode threw an error saying that that capability does not exist.

Was this removed after forking from cquery? I remember cquery containing this functionality.

company-lsp crashes ccls.

log

00:06:44 comp-query   clang_complete.cc:371 I create completion TU for /home/amos/cc/playground/default^2018-08-04-000454/snippet.cpp
00:06:44 comp-query       clang_tu.cc:106 E clang crashed for /home/amos/cc/playground/default^2018-08-04-000454/snippet.cpp
clang++ -std=c++17 -I/usr/local/include -I/usr/include /home/amos/cc/playground/default^2018-08-04-000454/snippet.cpp -resource-dir=/usr/local/lib/clang/7.0.0 -working-directory=/home/amos/cc/playground/default^2018-08-04-000454/ -Wno-unknown-warning-option -fsyntax-only

ccls 924fedb
llvm https://reviews.llvm.org/rL338899

A minimal reproducible case is

#include <iostream>

using namespace std;

int mymain(int argc, char *argv[]) {
    cou|
    return 0;
}

and M-x company-lsp at point.

The ccls launching script I used is,

exec ~/git/ccls/release/ccls --log-file=/tmp/cq.txt --init="{\"cacheDirectory\": \"/home/amos/.cache/.ccls_cached_index\", \"client\": {\"snippetSupport\": true}, \"index\": {\"reparseForDependency\": 1, \"comments\": 0}, \"diagnostics\": {\"frequencyMs\": 3000}, \"completion\": {\"includeBlacklist\": [\"llvm\", \"QT\", \"c++/7.3.0\", \"polly\", \"clang\"]},  \"extraClangArguments\": [\"-fno-delayed-template-parsing\", \"-std=c++1z\", $includes]}" "$@"

Clang SHA256 hash doesn't match

I tried to compile ccls for my system but cmake spitted out error in below.

cmake -H. -BRelease
-- The CXX compiler identification is GNU 5.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- Using downloaded Clang
-- Downloading Clang 6.0.1 (https://releases.llvm.org/6.0.1/clang+llvm-6.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz) ...
CMake Error at cmake/DownloadAndExtractClang.cmake:82 (message):
  SHA256 hash of downloaded Clang does not match expected hash.  Remove the
  build directory and try running CMake again.  If this keeps happening, file
  an issue to report the problem.
Call Stack (most recent call first):
  CMakeLists.txt:87 (download_and_extract_clang)


-- Configuring incomplete, errors occurred!
See also "/home/wonjun/workspace/ccls/Release/CMakeFiles/CMakeOutput.log".

Also I manually downloaded clang 6.0 from https://releases.llvm.org/6.0.1/clang+llvm-6.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz and copy it to build directory. However, cmake gave me same error messages.

How can I resolve this problem?
Currently I'm using ubuntu 16.04 and cmake 3.11

ccls complaints cannot found file

I am using the ccls-git from AUR. This weekend I just updated it and from then I keep receiving the error.

16:11:05 comp-preload clang_complete.cc:546 I create completion session for path_to_the_header_file
16:11:05 ccls         message_handler.cc:169 I unable to find file "path_to_the_header_file.", 

This header is generated from XML, after this I keep receiving the same error and completion is broken.

And do you know here what went wrong? Thanks.

clang complete session assert error

An assert often fails in debug version:

    frame #5: 0x00000000007889f0 ccls`loguru::log_and_abort(stack_trace_skip=0, expr="CHECK FAILED:  !completion_sessions_.TryGet(filename)  ", file="../src/clang_complete.cc", line=774) at loguru.hpp:2661
    frame #6: 0x00000000004ec504 ccls`ClangCompleteManager::TryGetSession(this=0x00007ffda03b6450, filename="XXX.cc", mark_as_completion=true, create_if_needed=true) at clang_complete.cc:774
    frame #7: 0x00000000004f99b4 ccls`(anonymous namespace)::DiagnosticQueryMain(completion_manager=0x00007ffda03b6450) at clang_complete.cc:593
    frame #8: 0x00000000004f9910 ccls`ClangCompleteManager::ClangCompleteManager(this=0x00000000028532c8)>, std::__1::function<void (lsRequestId)>)::$_2::operator()() const at clang_complete.cc:667

Not know the meaning. Dig later.

Foundation/Foundation.h file not found for Objective-C.

I am seeing "Foundation/Foundation.h file not found" error while trying to use ccls to parse an Objective-C file.

screen shot 2018-08-30 at 9 22 40 pm

I guess I need to use ccls to index built-in Objective-C library source files so that this error goes away. Is it correct?

Thanks!

Thanks for your hard work

As title, cquery/ccls is so awesome, the best c/c++ index tool I have ever seen. Thanks again for your hard work, wish it all the best :)

Clang::Clang not found on Gentoo x64

I am trying to compile ccls with -DSYSTEM_CLANG=on
When I execute the following command:

cmake -H. -BRelease -DSYSTEM_CLANG=on -DUSE_SHARED_LLVM=on -DCMAKE_CXX_COMPILER=clang++

I get the following error:

-- The CXX compiler identification is Clang 6.0.1
-- Check for working CXX compiler: /usr/lib/llvm/6/bin/clang++
-- Check for working CXX compiler: /usr/lib/llvm/6/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- Using system Clang
-- Could NOT find Clang (missing: Clang_LIBRARY Clang_INCLUDE_DIR LLVM_INCLUDE_DIR LLVM_BUILD_INCLUDE_DIR) (found suitable version "6.0.1", minimum required is "6.0.0")
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Configuring done
CMake Error at CMakeLists.txt:18 (add_executable):
  Target "ccls" links to target "Clang::Clang" but the target was not found.
  Perhaps a find_package() call is missing for an IMPORTED target, or an
  ALIAS target is missing?


-- Generating done
-- Build files have been written to: /home/DarkMonad/ccls/Release

My cmake version is:

cmake --version                                                                        
cmake version 3.9.6

And I am using the following clang version:

clang --version
clang version 6.0.1 (tags/RELEASE_601/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/6/bin

If I am not using -DSYSTEM_CLANG=on and use the downloaded clang version, everything works fine.
Am I doing something wrong or is this a bug?

How about using astyle to format the source code

git clone https://github.com/MaskRay/ccls
cd ccls/src
astyle --style=google --indent=spaces=2 --pad-oper --pad-header --pad-comma --delete-empty-lines --align-pointer=type --align-reference=type --add-braces --unpad-paren --max-code-length=80 --break-after-logical --suffix=none *.cc *.h
cd serializers
astyle --style=google --indent=spaces=2 --pad-oper --pad-header --pad-comma --delete-empty-lines --align-pointer=type --align-reference=type --add-braces --unpad-paren --max-code-length=80 --break-after-logical --suffix=none *.h
cd ../messages
astyle --style=google --indent=spaces=2 --pad-oper --pad-header --pad-comma --delete-empty-lines --align-pointer=type --align-reference=type --add-braces --unpad-paren --max-code-length=80 --break-after-logical --suffix=none *.cc

Only headers in the same directory are being indexed

I have just set ccls up with emacs. I've generated compile_commands, and when I run lsp-ccls-enable from a cc file, caches are created for system headers and the corresponding headers. They are not created for all the other headers from the project that are pulled in.

For example, in foo.cc (lets say it's in the projectroot/base directory), the following headers might exist.

include

#include "foo.h"

#include "base/bar.h"

After lsp-ccls-enable, .ccls-cache has
@usr@include@c++@7@memory and @usr@include@c++@[email protected]

as well as
[email protected], [email protected], [email protected], and [email protected]

I don't get any headers for [email protected] or [email protected] even though these are in the compile commands database.

Can you help me troubleshoot this? Finding references is not very useful with only a fraction of the project indexed and it's even worse for files that fully qualify their own header. If foo.cc had

#include "base/foo.h"

then the header is not indexed at all.

spurious ast read error

I've been struggling to resolve the following ccls.log entry

16:35:35 indexer7         clang_tu.cc:392 E libclang had ast read error for $file Please try running the following, identify which flag causes the issue, and report a bug. ccls will then filter the flag for you  automatically:

When I try with the given arguments with clang++ (both system and the one cmake downloads) it parses successfully and emits no output.

Error making: ccls-git from Archlinux/AUR.

I just tried to install ccls from aur/ccls-git and came into this error.

......
[ 94%] Building CXX object CMakeFiles/ccls.dir/src/messages/workspace_didChangeConfiguration.cc.o
[ 96%] Building CXX object CMakeFiles/ccls.dir/src/messages/workspace_didChangeWatchedFiles.cc.o
[ 98%] Building CXX object CMakeFiles/ccls.dir/src/messages/workspace_symbol.cc.o
[100%] Linking CXX executable ccls
/usr/bin/ld: cannot find -lLLVM_LIBRARY-NOTFOUND
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/ccls.dir/build.make:949: ccls] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/ccls.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
Error making: ccls-git

seems that it is related with llvm-libs?

here are my clang-llvm toolchains installed:

local/clang-analyzer-svn 7.0.0svn_r336353-1 (llvm-toolchain-svn)
    Source code analysis tool for Clang, supporting C, C++, and Objective-C
local/clang-compiler-rt-svn 7.0.0svn_r336353-1 (llvm-toolchain-svn)
    The "compiler-rt" set of runtime libraries for Clang and LLVM
local/clang-svn 7.0.0svn_r336353-1 (llvm-toolchain-svn)
    C language family frontend for LLVM
local/clang-tools-extra-svn 7.0.0svn_r336353-1 (llvm-toolchain-svn)
    Standalone tools for Clang: syntax checking, formatting, refactoring, etc.
local/liblphobos 1:1.10.0-1 (dlang dlang-ldc)
    A D Compiler based on the LLVM Compiler Infrastructure including D runtime and libphobos2
local/lld-svn 7.0.0svn_r336353-1 (llvm-toolchain-svn)
    A linker from the LLVM project
local/lldb-svn 7.0.0svn_r336353-1 (llvm-toolchain-svn)
    Next generation, high-performance debugger
local/llvm-libs-svn 7.0.0svn_r336353-1 (llvm-toolchain-svn)
    The LLVM Compiler Infrastructure (runtime libraries)
local/llvm-svn 7.0.0svn_r336353-1 (llvm-toolchain-svn)
    The LLVM Compiler Infrastructure
local/openmp-svn 5.0.r336411-1
    LLVM OpenMP Runtime Library

so, what should I do? Thanks!

compile error

OS: LinuxMint18.3 (Ubuntu 16.04.1)
Emacs:27.1
CMake:3.12.20180715-g1a1e
Clang:6.0.1

cd $DEV_ROOT/ccls/build/
cmake .. \
    -DCMAKE_CXX_COMPILER=clang++ \
    -DCMAKE_CXX_STANDARD=17 \
    -DCMAKE_CXX_STANDARD_REQUIRED=ON \
    -DCMAKE_INSTALL_PREFIX=$HOME/.ccls \
    -DCMAKE_EXPORT_COMPILE_COMMANDS=YES \
    -DCMAKE_BUILD_TYPE=Release \
    -DSYSTEM_CLANG=OFF
make install
-- The CXX compiler identification is Clang 3.8.0

-- Check for working CXX compiler: /usr/bin/clang++

-- Check for working CXX compiler: /usr/bin/clang++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Detecting CXX compile features

-- Detecting CXX compile features - done

-- Using downloaded Clang

-- Found Curses: /usr/lib/x86_64-linux-gnu/libcurses.so

-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")

-- Clang already downloaded

-- Found Clang: /home/damon/.dev/ccls/build/clang+llvm-6.0.1-x86_64-linux-gnu-ubuntu-16.04/lib/libclangIndex.a (found suitable version "6.0.1", minimum required is "6.0.0")

-- Looking for C++ include pthread.h

-- Looking for C++ include pthread.h - found

-- Looking for pthread_create

-- Looking for pthread_create - not found

-- Check if compiler accepts -pthread

-- Check if compiler accepts -pthread - yes

-- Found Threads: TRUE

-- Configuring done

-- Generating done

-- Build files have been written to: /home/damon/.dev/ccls/build

Scanning dependencies of target ccls

[ 1%] Building CXX object CMakeFiles/ccls.dir/third_party/siphash.cc.o

[ 3%] Building CXX object CMakeFiles/ccls.dir/src/clang_complete.cc.o

In file included from /home/damon/.dev/ccls/src/clang_complete.cc:1:

In file included from /home/damon/.dev/ccls/src/clang_complete.h:3:

In file included from /home/damon/.dev/ccls/src/clang_tu.h:2:

In file included from /home/damon/.dev/ccls/src/position.h:3:

In file included from /home/damon/.dev/ccls/src/maybe.h:5:

In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/utility:70:

In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_pair.h:59:

In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/move.h:54:

/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2656:5: error: 'inline' can only appear on functions

_GLIBCXX17_INLINE constexpr bool is_swappable_v =
^

/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0
/bits/c++config.h:127:29: note: expanded from macro '_GLIBCXX17_INLINE'

define _GLIBCXX17_INLINE inline

                        ^

In file included from /home/damon/.dev/ccls/src/clang_complete.cc:1:

In file included from /home/damon/.dev/ccls/src/clang_complete.h:3:

In file included from /home/damon/.dev/ccls/src/clang_tu.h:2:

In file included from /home/damon/.dev/ccls/src/position.h:3:

In file included from /home/damon/.dev/ccls/src/maybe.h:5:

In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/utility:70:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_pair.h:59:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/move.h:54:
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2661:5: error: 'inline' can only appear on functions
_GLIBCXX17_INLINE constexpr bool is_nothrow_swappable_v =
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0/bits/c++config.h:127:29: note: expanded from macro '_GLIBCXX17_INLINE'

define _GLIBCXX17_INLINE inline

                        ^

In file included from /home/damon/.dev/ccls/src/clang_complete.cc:1:

In file included from /home/damon/.dev/ccls/src/clang_complete.h:3:

In file included from /home/damon/.dev/ccls/src/clang_tu.h:2:

In file included from /home/damon/.dev/ccls/src/position.h:3:

In file included from /home/damon/.dev/ccls/src/maybe.h:5:

In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/utility:70:

In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_pair.h:59:

In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/move.h:54:

/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2740:5: error: 'inline' can only appear on functions

_GLIBCXX17_INLINE constexpr bool is_swappable_with_v =
^

/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0
/bits/c++config.h:127:29: note: expanded from macro '_GLIBCXX17_INLINE'

define _GLIBCXX17_INLINE inline

                        ^

In file included from /home/damon/.dev/ccls/src/clang_complete.cc:1:

In file included from /home/damon/.dev/ccls/src/clang_complete.h:3:

In file included from /home/damon/.dev/ccls/src/clang_tu.h:2:

In file included from /home/damon/.dev/ccls/src/position.h:3:

In file included from /home/damon/.dev/ccls/src/maybe.h:5:

In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/utility:70:

In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_pair.h:59:

In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/move.h:54:

/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2745:5: error: 'inline' can only appear on functions

_GLIBCXX17_INLINE constexpr bool is_nothrow_swappable_with_v =
^

/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/x86_64-linux-gnu/c++/7.3.0/bits/c++config.h:127:29: note: expanded from macro '_GLIBCXX17_INLINE'

define _GLIBCXX17_INLINE inline

                        ^

In file included from /home/damon/.dev/ccls/src/clang_complete.cc:1:

In file included from /home/damon/.dev/ccls/src/clang_complete.h:3:
In file included from /home/damon/.dev/ccls/src/clang_tu.h:2:
In file included from /home/damon/.dev/ccls/src/position.h:3:
In file included from /home/damon/.dev/ccls/src/maybe.h:5:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/utility:70:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_pair.h:59:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/move.h:54:
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2877:5: error: 'inline' can only appear on functions
inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2881:5: error: 'inline' can only appear on functions
inline constexpr bool is_nothrow_invocable_v
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2886:5: error: 'inline' can only appear on functions
inline constexpr bool is_invocable_r_v
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2891:5: error: 'inline' can only appear on functions
inline constexpr bool is_nothrow_invocable_r_v
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2898:3: error: 'inline' can only appear on functions
inline constexpr bool is_void_v = is_void<_Tp>::value;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2900:3: error: 'inline' can only appear on functions
inline constexpr bool is_null_pointer_v = is_null_pointer<_Tp>::value;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2902:3: error: 'inline' can only appear on functions
inline constexpr bool is_integral_v = is_integral<_Tp>::value;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2904:3: error: 'inline' can only appear on functions
inline constexpr bool is_floating_point_v = is_floating_point<_Tp>::value;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2906:3: error: 'inline' can only appear on functions
inline constexpr bool is_array_v = is_array<_Tp>::value;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2908:3: error: 'inline' can only appear on functions
inline constexpr bool is_pointer_v = is_pointer<_Tp>::value;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2910:3: error: 'inline' can only appear on functions
inline constexpr bool is_lvalue_reference_v =
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2913:3: error: 'inline' can only appear on functions
inline constexpr bool is_rvalue_reference_v =
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2916:3: error: 'inline' can only appear on functions
inline constexpr bool is_member_object_pointer_v =
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2919:3: error: 'inline' can only appear on functions
inline constexpr bool is_member_function_pointer_v =
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/type_traits:2922:3: error: 'inline' can only appear on functions
inline constexpr bool is_enum_v = is_enum<_Tp>::value;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
CMakeFiles/ccls.dir/build.make:75: recipe for target 'CMakeFiles/ccls.dir/src/clang_complete.cc.o' failed
make[2]: *** [CMakeFiles/ccls.dir/src/clang_complete.cc.o] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/ccls.dir/all' failed
make[1]: *** [CMakeFiles/ccls.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

How to escape backslashes?

Even though I thought this is a CMake/Ninja problem, since you have successfully built the ccls on Windows, it will be nice if you can help me around this.

This is my cmake command

cmake . -Brelease -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DSYSTEM_CLANG=On -DCMAKE_PREFIX_PATH="D:\\Programs\\msys64\\mingw64\\lib\\clang\\6.0.0\\"
cmake --build release

I tried both / and \\ to split the path, but didn't help.

This caused the following errors:

[8/59] Building CXX object CMakeFiles/ccls.dir/src/main.cc.obj
FAILED: CMakeFiles/ccls.dir/src/main.cc.obj
D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=\"D:\Programs\msys64\mingw64\lib\clang\6.0.0\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/main.cc.obj -MF CMakeFiles\ccls.dir\src\main.cc.obj.d -o CMakeFiles/ccls.dir/src/main.cc.obj -c ../src/main.cc
../src/main.cc:70:3: error: use of undeclared identifier '_setmode'
  _setmode(_fileno(stdout), O_BINARY);
  ^
../src/main.cc:71:3: error: use of undeclared identifier '_setmode'
  _setmode(_fileno(stdin), O_BINARY);
  ^
2 errors generated.
[17/59] Building CXX object CMakeFiles/ccls.dir/src/indexer.cc.obj

Btw, what's the purpose of cmake -H. in the wiki?

link error to LLVMSupport

CMakeFiles/ccls.dir/src/main.cc.o: In function `OptionValue':
/home/shc/code/repos/ccls/build/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04/include/llvm/Support/CommandLine.h:575: undefined reference to `vtable for llvm::cl::OptionValue<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >'
CMakeFiles/ccls.dir/src/main.cc.o: In function `opt<char [5], llvm::cl::desc>':
/home/shc/code/repos/ccls/build/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04/include/llvm/Support/CommandLine.h:1359: undefined reference to `vtable for llvm::cl::opt<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, false, llvm::cl::parser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >'
CMakeFiles/ccls.dir/src/main.cc.o: In function `parser':
/home/shc/code/repos/ccls/build/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04/include/llvm/Support/CommandLine.h:1028: undefined reference to `vtable for llvm::cl::parser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >'
CMakeFiles/ccls.dir/src/main.cc.o: In function `OptionValue':
/home/shc/code/repos/ccls/build/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04/include/llvm/Support/CommandLine.h:575: undefined reference to `vtable for llvm::cl::OptionValue<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >'
CMakeFiles/ccls.dir/src/main.cc.o: In function `opt<char [9], llvm::cl::desc, llvm::cl::value_desc>':
/home/shc/code/repos/ccls/build/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04/include/llvm/Support/CommandLine.h:1359: undefined reference to `vtable for llvm::cl::opt<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, false, llvm::cl::parser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >'
CMakeFiles/ccls.dir/src/main.cc.o: In function `parser':
/home/shc/code/repos/ccls/build/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04/include/llvm/Support/CommandLine.h:1028: undefined reference to `vtable for llvm::cl::parser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >'
CMakeFiles/ccls.dir/src/main.cc.o: In function `OptionValue':
/home/shc/code/repos/ccls/build/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04/include/llvm/Support/CommandLine.h:575: undefined reference to `vtable for llvm::cl::OptionValue<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >'
CMakeFiles/ccls.dir/src/main.cc.o: In function `opt<char [16], llvm::cl::desc, llvm::cl::value_desc>':
/home/shc/code/repos/ccls/build/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04/include/llvm/Support/CommandLine.h:1359: undefined reference to `vtable for llvm::cl::opt<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, false, llvm::cl::parser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >'
CMakeFiles/ccls.dir/src/main.cc.o: In function `parser':
/home/shc/code/repos/ccls/build/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04/include/llvm/Support/CommandLine.h:1028: undefined reference to `vtable for llvm::cl::parser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >'
/home/shc/code/repos/ccls/build/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04/include/llvm/Support/CommandLine.h:1028: undefined reference to `vtable for llvm::cl::parser<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >'
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Is the bundled LLVM not compiled with c++11?

ccls returns wrong "kind" for symbol

When browsing C repository (emacs source code, latest), if one makes a "textDocument/documentSymbol" request from emacs, you get back some hash tables with "kind" field set to 255 (maximum this should be is 26, as per https://github.com/Microsoft/language-server-protocol/blob/f46eb9656ad07d25a93e498d9ee3507f71317fb1/versions/protocol-1-x.md#document-symbols)

Steps to reproduce:

  1. Open emacs C source code in emacs (27.0.50)
  2. open lisp.h in src directory
  3. send the following request M-:
(lsp--send-request
        (lsp--make-request "textDocument/documentSymbol"
                           `(:textDocument
                             ,(lsp--text-document-identifier))))
  1. go to messages buffer and copy over the hash table returned, inspect values and see that the "kind" field has weird values like 255.

ccls assumes cc is clang

After properly setting up ccls for my project i got a problem from ccls server.
It assumes that cc is clang while on my system it is gcc and it passes some arguments like
-resource-dir=/usr/lib/clang/6.0.0, -fspell-checking, -fparse-all-comments, -working-directory
that gcc does not support and eventually lsp-stderr has this libclang crash detected during parsing

Can't find Clang::Clang on Raspberry Pi

Hi, I try to build ccls on the Raspberry Pi platform (its OS is a Debian derivation) with the following package installed:
sudo apt-get install clang libclang-dev libclang1 llvm llvm-dev clang-tools

But run into error:

$cmake -H.. -BRelease -DSYSTEM_CLANG=ON
-- The CXX compiler identification is GNU 6.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- Using system Clang
-- Could NOT find Clang (missing:  Clang_LIBRARY Clang_INCLUDE_DIR) (found suitable version "6.0.1", minimum required is "6.0.0")
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Configuring done
CMake Error at CMakeLists.txt:18 (add_executable):
  Target "ccls" links to target "Clang::Clang" but the target was not found.
  Perhaps a find_package() call is missing for an IMPORTED target, or an
  ALIAS target is missing?


CMake Error in CMakeLists.txt:
  Target "ccls" requires the language dialect "CXX17" , but CMake does not
  know the compile flags to use to enable it.


-- Generating done
-- Build files have been written to: /home/pi/projects/ccls/build/Release

I referred the build wiki, and checked some required file on my system:

/usr/lib/llvm-6.0/include/clang/Config/config.h
/usr/lib/llvm-6.0/lib/libclangIndex.a
/usr/lib/llvm-6.0/lib/libclang.so
$ clang -print-resource-dir
/usr/lib/llvm-6.0/lib/clang/6.0.1

How can I solve it? Thanks!

ccls can't find subproject header

Hi. I'm trying to configure ccls for my C++ project.
It works really smooths and it is really fast.
However ccls can't detect some header files and I can't figure out that this is caused by my cmake config
or wrong behavior of ccls.

Problems

  • ccls cannot complete header file location. (Only cannot find subporject's header files)
  • ccls cannot complete class methods which is defined in subproject(I guess this is related to previous issue)

The problem is that ccls failed to detect headers in external subporject in my project. I'm using two subproject currently (fmt and eigen). They are just git submodule from another github repo.
For instance let's say I want to use include fmt/core.h in my project which is located in fmt project.
If I type #include <fm ccls does not suggest any header file candidates in fmt project.

Emacs config

(use-package ccls
  :init
  (progn
    (spacemacs|add-company-backends :backends company-lsp :modes c-mode-common)
    (spacemacs/add-to-hooks #'lsp-ccls-enable '(c-mode-hook c++-mode-hook))
    (dolist (mode '(c-mode c++-mode))
      (spacemacs/declare-prefix-for-mode mode "ml" "lsp")
      (spacemacs/declare-prefix-for-mode mode "mh" "hierarchy")
      (evil-leader/set-key-for-mode mode
        "." #'lsp-ui-peek-find-definitions
        "," #'lsp-ui-peek-find-references
        "[" #'lsp-ui-peek-jump-backward
        "]" #'lsp-ui-peek-jump-forward))
    )
  :config
  (setq company-transformers nil
        company-lsp-async t
        company-lsp-cache-candidates nil)
  (setq ccls-executable "/usr/local/bin/ccls")
  )

Project setup
PROJECT_ROOT/CMakeLists.txt

...

add_subdirectory(extern)

...

target_link_libraries(${PROJECT_NAME}
  PUBLIC
  fmt::fmt
  eigen::eigen
  )

extern/CMakeLists.txt

set(EXTERN_MODULE_DIR "${PROJECT_SOURCE_DIR}/extern")

# Add fmt
add_subdirectory(fmt)

# Add Eigen
set(EIGEN_INCLUDE_DIR "${EXTERN_MODULE_DIR}/eigen")
add_library(eigen INTERFACE)
target_include_directories(eigen INTERFACE
  $<INSTALL_INTERFACE:include/Eigen>
  $<BUILD_INTERFACE:${EIGEN_INCLUDE_DIR}>
  )
add_library(eigen::eigen ALIAS eigen)

Proejct structure

.
โ”œโ”€โ”€ build
โ”œโ”€โ”€ cmake
โ”œโ”€โ”€ extern
โ”‚ย ย  โ”œโ”€โ”€ eigen
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Eigen
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ bench
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ blas
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ cmake
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ debug
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ demos
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ doc
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ failtest
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ lapack
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ scripts
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ test
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ unsupported
โ”‚ย ย  โ””โ”€โ”€ fmt
โ”‚ย ย      โ”œโ”€โ”€ doc
โ”‚ย ย      โ”œโ”€โ”€ include
โ”‚ย ย      โ”œโ”€โ”€ src
โ”‚ย ย      โ”œโ”€โ”€ support
โ”‚ย ย      โ””โ”€โ”€ test
โ”œโ”€โ”€ include
โ”‚ย ย  โ”œโ”€โ”€ rfwr
โ”‚ย ย  โ””โ”€โ”€ test
โ””โ”€โ”€ src

segmentation fault (core dumped)

a couple hours ago, ccls was just fine. I tested some basic features under spacemacs.

However, two hours ago, after I recompiled aur/ccls-git and updated lsp-mode, ccls package in emacs, errors occurred!

coredump info:

$ coredumpctl info 22625
           PID: 22625 (ccls)
           PID: 22625 (ccls)
           UID: 1000 (shaikh)
           GID: 1000 (shaikh)
        Signal: 11 (SEGV)
     Timestamp: Mon 2018-07-09 17:02:15 CST (19s ago)
  Command Line: /usr/bin/ccls --log-file=/tmp/ccls.log
    Executable: /usr/bin/ccls
 Control Group: /user.slice/user-1000.slice/session-c1.scope
          Unit: session-c1.scope
         Slice: user-1000.slice
       Session: c1
     Owner UID: 1000 (shaikh)
       Boot ID: efe30e1d1af340cdb19ae8455ccd625d
    Machine ID: 26f090b164cf43619ddb4a3c9c38ae60
      Hostname: ArchX
       Storage: /var/lib/systemd/coredump/core.ccls.1000.efe30e1d1af340cdb19ae8455ccd625d.22625.1531126935000000.lz4
       Message: Process 22625 (ccls) of user 1000 dumped core.
                
                Stack trace of thread 22633:
                #0  0x00007efe317f9d08 _ZN4llvm3sys2fs6detail28directory_iterator_constructERNS2_12DirIterStateENS_9StringRefEb (libLLVM-7svn.so)
                #1  0x0000560f164d3bd8 n/a (ccls)
                #2  0x0000560f163c39f1 n/a (ccls)
                #3  0x0000560f163c4a3b n/a (ccls)
                #4  0x0000560f163d81a5 n/a (ccls)
                #5  0x0000560f1633495b _ZNK5clang6driver6Driver12getToolChainERKN4llvm3opt7ArgListERKNS2_6TripleE (ccls)
                #6  0x0000560f16340343 _ZN5clang6driver6Driver16BuildCompilationEN4llvm8ArrayRefIPKcEE (ccls)
                #7  0x0000560f1578a207 _ZN5clang31createInvocationFromCommandLineEN4llvm8ArrayRefIPKcEENS0_18IntrusiveRefCntPtrINS_17DiagnosticsEngineEEENS5_INS_3vfs10FileSystemEEE (ccls)
                #8  0x0000560f1562d71c _ZN4ccls3idx5IndexEP3VFSRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_RKSt6vectorIS8_SaIS8_EERKSB_I12FileContentsSaISG_EE (ccls)
                #9  0x0000560f156679b1 n/a (ccls)
                #10 0x0000560f15668adc _ZN4ccls8pipeline12Indexer_MainEP20DiagnosticsPublisherP3VFSP7ProjectP12WorkingFiles (ccls)
                #11 0x0000560f156d352d n/a (ccls)
                #12 0x00007efe30c5bd4f execute_native_thread_routine (libstdc++.so.6)
                #13 0x00007efe30772075 start_thread (libpthread.so.0)
                #14 0x00007efe304a753f __clone (libc.so.6)
                
                Stack trace of thread 22625:
                #0  0x00007efe30777ffc pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
                #1  0x00007efe30c55d6d __gthread_cond_wait (libstdc++.so.6)
                #2  0x0000560f15669cf2 _ZN4ccls8pipeline8MainLoopEv (ccls)
                #3  0x0000560f155feebc main (ccls)
                #4  0x00007efe303d206b __libc_start_main (libc.so.6)
                #5  0x0000560f1560365a _start (ccls)
                
                Stack trace of thread 22632:
                #0  0x00007efe317f9d08 _ZN4llvm3sys2fs6detail28directory_iterator_constructERNS2_12DirIterStateENS_9StringRefEb (libLLVM-7svn.so)
                #1  0x0000560f164d3bd8 n/a (ccls)
                #2  0x0000560f163c39f1 n/a (ccls)
                #3  0x0000560f163c4a3b n/a (ccls)
                #4  0x0000560f163d81a5 n/a (ccls)
                #5  0x0000560f1633495b _ZNK5clang6driver6Driver12getToolChainERKN4llvm3opt7ArgListERKNS2_6TripleE (ccls)
                #6  0x0000560f16340343 _ZN5clang6driver6Driver16BuildCompilationEN4llvm8ArrayRefIPKcEE (ccls)
                #7  0x0000560f1578a207 _ZN5clang31createInvocationFromCommandLineEN4llvm8ArrayRefIPKcEENS0_18IntrusiveRefCntPtrINS_17DiagnosticsEngineEEENS5_INS_3vfs10FileSystemEEE (ccls)
                #8  0x0000560f1562d71c _ZN4ccls3idx5IndexEP3VFSRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_RKSt6vectorIS8_SaIS8_EERKSB_I12FileContentsSaISG_EE (ccls)
                #9  0x0000560f156679b1 n/a (ccls)
                #10 0x0000560f15668adc _ZN4ccls8pipeline12Indexer_MainEP20DiagnosticsPublisherP3VFSP7ProjectP12WorkingFiles (ccls)
                #11 0x0000560f156d352d n/a (ccls)
                #12 0x00007efe30c5bd4f execute_native_thread_routine (libstdc++.so.6)
                #13 0x00007efe30772075 start_thread (libpthread.so.0)
                #14 0x00007efe304a753f __clone (libc.so.6)
                
                Stack trace of thread 22627:
                #0  0x00007efe30777ffc pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
                #1  0x00007efe30c55d6d __gthread_cond_wait (libstdc++.so.6)
                #2  0x0000560f1566478b n/a (ccls)
                #3  0x00007efe30c5bd4f execute_native_thread_routine (libstdc++.so.6)
                #4  0x00007efe30772075 start_thread (libpthread.so.0)
                #5  0x00007efe304a753f __clone (libc.so.6)
                
                Stack trace of thread 22634:
                #0  0x00007efe3077cb50 __libc_sigaction (libpthread.so.0)
                #1  0x00007efe31804af1 _ZL13SignalHandleri (libLLVM-7svn.so)
                #2  0x00007efe3077ca80 __restore_rt (libpthread.so.0)
                #3  0x00007efe317f9d08 _ZN4llvm3sys2fs6detail28directory_iterator_constructERNS2_12DirIterStateENS_9StringRefEb (libLLVM-7svn.so)
                #4  0x0000560f164d3bd8 n/a (ccls)
                #5  0x0000560f163c39f1 n/a (ccls)
                #6  0x0000560f163c4a3b n/a (ccls)
                #7  0x0000560f163d81a5 n/a (ccls)
                #8  0x0000560f1633495b _ZNK5clang6driver6Driver12getToolChainERKN4llvm3opt7ArgListERKNS2_6TripleE (ccls)
                #9  0x0000560f16340343 _ZN5clang6driver6Driver16BuildCompilationEN4llvm8ArrayRefIPKcEE (ccls)
                #10 0x0000560f1578a207 _ZN5clang31createInvocationFromCommandLineEN4llvm8ArrayRefIPKcEENS0_18IntrusiveRefCntPtrINS_17DiagnosticsEngineEEENS5_INS_3vfs10FileSystemEEE (ccls)
                #11 0x0000560f1562d71c _ZN4ccls3idx5IndexEP3VFSRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_RKSt6vectorIS8_SaIS8_EERKSB_I12FileContentsSaISG_EE (ccls)
                #12 0x0000560f156679b1 n/a (ccls)
                #13 0x0000560f15668adc _ZN4ccls8pipeline12Indexer_MainEP20DiagnosticsPublisherP3VFSP7ProjectP12WorkingFiles (ccls)
                #14 0x0000560f156d352d n/a (ccls)
                #15 0x00007efe30c5bd4f execute_native_thread_routine (libstdc++.so.6)
                #16 0x00007efe30772075 start_thread (libpthread.so.0)
                #17 0x00007efe304a753f __clone (libc.so.6)
                
                Stack trace of thread 22628:
                #0  0x00007efe30777ffc pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
                #1  0x00007efe30c55d6d __gthread_cond_wait (libstdc++.so.6)
                #2  0x0000560f1560ed51 _ZNSt3_V222condition_variable_any4waitISt11unique_lockISt5mutexEEEvRT_ (ccls)
                #3  0x0000560f1560f09b _ZN13ThreadedQueueISt10unique_ptrIN20ClangCompleteManager17CompletionRequestESt14default_deleteIS2_EEE7DequeueEv (ccls)
                #4  0x0000560f1560a71b n/a (ccls)
                #5  0x0000560f1560b7bf n/a (ccls)
                #6  0x00007efe30c5bd4f execute_native_thread_routine (libstdc++.so.6)
                #7  0x00007efe30772075 start_thread (libpthread.so.0)
                #8  0x00007efe304a753f __clone (libc.so.6)
                
                Stack trace of thread 22629:
                #0  0x00007efe30777ffc pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
                #1  0x00007efe30c55d6d __gthread_cond_wait (libstdc++.so.6)
                #2  0x0000560f1560ed51 _ZNSt3_V222condition_variable_any4waitISt11unique_lockISt5mutexEEEvRT_ (ccls)
                #3  0x0000560f15609960 n/a (ccls)
                #4  0x0000560f15609a6f n/a (ccls)
                #5  0x00007efe30c5bd4f execute_native_thread_routine (libstdc++.so.6)
                #6  0x00007efe30772075 start_thread (libpthread.so.0)
                #7  0x00007efe304a753f __clone (libc.so.6)
                
                Stack trace of thread 22630:
                #0  0x00007efe30777ffc pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
                #1  0x00007efe30c55d6d __gthread_cond_wait (libstdc++.so.6)
                #2  0x0000560f1560ed51 _ZNSt3_V222condition_variable_any4waitISt11unique_lockISt5mutexEEEvRT_ (ccls)
                #3  0x0000560f1560a2d6 n/a (ccls)
                #4  0x0000560f1560a6bf n/a (ccls)
                #5  0x00007efe30c5bd4f execute_native_thread_routine (libstdc++.so.6)
                #6  0x00007efe30772075 start_thread (libpthread.so.0)
                #7  0x00007efe304a753f __clone (libc.so.6)
                
                Stack trace of thread 22626:
                #0  0x00007efe30498934 __read (libc.so.6)
                #1  0x00007efe3042a788 _IO_file_underflow@@GLIBC_2.2.5 (libc.so.6)
                #2  0x00007efe3042b8a2 _IO_default_uflow (libc.so.6)
                #3  0x00007efe304261f0 _IO_getc (libc.so.6)
                #4  0x0000560f15638d5e _Z25ReadCharFromStdinBlockingv (ccls)
                #5  0x0000560f156393e7 _Z22ReadJsonRpcContentFromB5cxx11St8functionIFSt8optionalIcEvEE (ccls)
                #6  0x0000560f1563c30c _ZN15MessageRegistry20ReadMessageFromStdinB5cxx11EPSt10unique_ptrI9InMessageSt14default_deleteIS1_EE (ccls)
                #7  0x0000560f15665606 n/a (ccls)
                #8  0x00007efe30c5bd4f execute_native_thread_routine (libstdc++.so.6)
                #9  0x00007efe30772075 start_thread (libpthread.so.0)
                #10 0x00007efe304a753f __clone (libc.so.6)
                
                Stack trace of thread 22631:
                #0  0x00007efe30509669 __strlen_avx2 (libc.so.6)
                #1  0x00007efe32a99b7c _ZNK4llvm3opt8OptTable11ParseOneArgERKNS0_7ArgListERjjj (libLLVM-7svn.so)
                #2  0x00007efe32a9a17e _ZNK4llvm3opt8OptTable9ParseArgsENS_8ArrayRefIPKcEERjS6_jj (libLLVM-7svn.so)
                #3  0x0000560f16326dbc _ZN5clang6driver6Driver15ParseArgStringsEN4llvm8ArrayRefIPKcEERb (ccls)
                #4  0x0000560f1633fc2b _ZN5clang6driver6Driver16BuildCompilationEN4llvm8ArrayRefIPKcEE (ccls)
                #5  0x0000560f1578a207 _ZN5clang31createInvocationFromCommandLineEN4llvm8ArrayRefIPKcEENS0_18IntrusiveRefCntPtrINS_17DiagnosticsEngineEEENS5_INS_3vfs10FileSystemEEE (ccls)
                #6  0x0000560f1562d71c _ZN4ccls3idx5IndexEP3VFSRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_RKSt6vectorIS8_SaIS8_EERKSB_I12FileContentsSaISG_EE (ccls)
                #7  0x0000560f156679b1 n/a (ccls)
                #8  0x0000560f15668adc _ZN4ccls8pipeline12Indexer_MainEP20DiagnosticsPublisherP3VFSP7ProjectP12WorkingFiles (ccls)
                #9  0x0000560f156d352d n/a (ccls)
                #10 0x00007efe30c5bd4f execute_native_thread_routine (libstdc++.so.6)
                #11 0x00007efe30772075 start_thread (libpthread.so.0)
                #12 0x00007efe304a753f __clone (libc.so.6)

           PID: 22625 (ccls)
           UID: 1000 (shaikh)
           GID: 1000 (shaikh)
        Signal: 11 (SEGV)
     Timestamp: Mon 2018-07-09 17:02:15 CST (19s ago)
  Command Line: /usr/bin/ccls --log-file=/tmp/ccls.log
    Executable: /usr/bin/ccls
 Control Group: /user.slice/user-1000.slice/session-c1.scope
          Unit: session-c1.scope
         Slice: user-1000.slice
       Session: c1
     Owner UID: 1000 (shaikh)
       Boot ID: efe30e1d1af340cdb19ae8455ccd625d
    Machine ID: 26f090b164cf43619ddb4a3c9c38ae60
      Hostname: ArchX
       Storage: /var/lib/systemd/coredump/core.ccls.1000.efe30e1d1af340cdb19ae8455ccd625d.22625.1531126935000000.lz4
       Message: Process 22625 (ccls) of user 1000 dumped core.
                
                Stack trace of thread 22633:
                #0  0x00007efe317f9d08 _ZN4llvm3sys2fs6detail28directory_iterator_constructERNS2_12DirIterStateENS_9StringRefEb (libLLVM-7svn.so)
                #1  0x0000560f164d3bd8 n/a (ccls)
                #2  0x0000560f163c39f1 n/a (ccls)
                #3  0x0000560f163c4a3b n/a (ccls)
                #4  0x0000560f163d81a5 n/a (ccls)
                #5  0x0000560f1633495b _ZNK5clang6driver6Driver12getToolChainERKN4llvm3opt7ArgListERKNS2_6TripleE (ccls)
                #6  0x0000560f16340343 _ZN5clang6driver6Driver16BuildCompilationEN4llvm8ArrayRefIPKcEE (ccls)
                #7  0x0000560f1578a207 _ZN5clang31createInvocationFromCommandLineEN4llvm8ArrayRefIPKcEENS0_18IntrusiveRefCntPtrINS_17DiagnosticsEng
ineEEENS5_INS_3vfs10FileSystemEEE (ccls)
                #8  0x0000560f1562d71c _ZN4ccls3idx5IndexEP3VFSRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_RKSt6vectorIS8_SaIS8_EERKSB
_I12FileContentsSaISG_EE (ccls)
                #9  0x0000560f156679b1 n/a (ccls)
...skipping...
                #7  0x00007efe304a753f __clone (libc.so.6)
                
                Stack trace of thread 22626:
                #0  0x00007efe30498934 __read (libc.so.6)
                #1  0x00007efe3042a788 _IO_file_underflow@@GLIBC_2.2.5 (libc.so.6)
                #2  0x00007efe3042b8a2 _IO_default_uflow (libc.so.6)
                #3  0x00007efe304261f0 _IO_getc (libc.so.6)
                #4  0x0000560f15638d5e _Z25ReadCharFromStdinBlockingv (ccls)
                #5  0x0000560f156393e7 _Z22ReadJsonRpcContentFromB5cxx11St8functionIFSt8optionalIcEvEE (ccls)
                #6  0x0000560f1563c30c _ZN15MessageRegistry20ReadMessageFromStdinB5cxx11EPSt10unique_ptrI9InMessageSt14default_deleteIS1_EE (ccls)
                #7  0x0000560f15665606 n/a (ccls)
                #8  0x00007efe30c5bd4f execute_native_thread_routine (libstdc++.so.6)
                #9  0x00007efe30772075 start_thread (libpthread.so.0)
                #10 0x00007efe304a753f __clone (libc.so.6)
                
                Stack trace of thread 22631:
                #0  0x00007efe30509669 __strlen_avx2 (libc.so.6)
                #1  0x00007efe32a99b7c _ZNK4llvm3opt8OptTable11ParseOneArgERKNS0_7ArgListERjjj (libLLVM-7svn.so)
                #2  0x00007efe32a9a17e _ZNK4llvm3opt8OptTable9ParseArgsENS_8ArrayRefIPKcEERjS6_jj (libLLVM-7svn.so)
                #3  0x0000560f16326dbc _ZN5clang6driver6Driver15ParseArgStringsEN4llvm8ArrayRefIPKcEERb (ccls)
                #4  0x0000560f1633fc2b _ZN5clang6driver6Driver16BuildCompilationEN4llvm8ArrayRefIPKcEE (ccls)
                #5  0x0000560f1578a207 _ZN5clang31createInvocationFromCommandLineEN4llvm8ArrayRefIPKcEENS0_18IntrusiveRefCntPtrINS_17DiagnosticsEngineEEENS5_INS_3vfs10FileSystemEEE (ccls)
                #6  0x0000560f1562d71c _ZN4ccls3idx5IndexEP3VFSRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_RKSt6vectorIS8_SaIS8_EERKSB_I12FileContentsSaISG_EE (ccls)
                #7  0x0000560f156679b1 n/a (ccls)
                #8  0x0000560f15668adc _ZN4ccls8pipeline12Indexer_MainEP20DiagnosticsPublisherP3VFSP7ProjectP12WorkingFiles (ccls)
                #9  0x0000560f156d352d n/a (ccls)
                #10 0x00007efe30c5bd4f execute_native_thread_routine (libstdc++.so.6)
                #11 0x00007efe30772075 start_thread (libpthread.so.0)
                #12 0x00007efe304a753f __clone (libc.so.6)

ccls-log:

$ cat /tmp/ccls.log             
17:02:15 ccls           initialize.cc:431 I initializationOptions: {"compilationDatabaseCommand":"","compilationDatabaseDirectory":"","cacheDirectory":"/home/shaikh/Documents/modern.c++/part1/chap2/.ccls-cache/","cacheFormat":"binary","clang":{"extraArgs":["-D__cpp_deduction_guides=0","-Wno-macro-redefined"],"resourceDir":""},"client":{"snippetSupport":false},"codeLens":{"localVariables":true},"completion":{"caseSensitivity":2,"dropOldRequests":true,"detailedLabel":false,"filterAndSort":true,"includeBlacklist":[],"includeMaxPathSize":30,"includeSuffixWhitelist":[".h",".hpp",".hh"],"includeWhitelist":[]},"diagnostics":{"blacklist":[],"frequencyMs":0,"onParse":true,"onType":true,"whitelist":[]},"highlight":{"blacklist":[],"whitelist":[]},"index":{"attributeMakeCallsToCtor":true,"blacklist":[],"comments":2,"enabled":true,"onDidChange":false,"reparseForDependency":2,"threads":0,"whitelist":[]},"largeFileSize":2097152,"workspaceSymbol":{"caseSensitivity":1,"maxNum":1000,"sort":true},"xref":{"container":false,"maxNum":2000}}
17:02:15 ccls           initialize.cc:435 I initialize in directory /home/shaikh/Documents/modern.c++/part1/chap2 with uri file:///home/shaikh/Documents/modern.c++/part1/chap2/
17:02:15 ccls           initialize.cc:472 I Using -resource-dir=/usr/lib/clang/7.0.0
17:02:15 ccls              project.cc:319 I loaded /home/shaikh/Documents/modern.c++/part1/chap2/compile_commands.json
17:02:15 ccls           initialize.cc:506 I start 4 indexers
17:02:15 ccls           initialize.cc:520 I dispatch initial index requests
17:02:15 indexer2         pipeline.cc:219 I parse /home/shaikh/Documents/modern.c++/part1/chap2/2.4-const.cpp
17:02:15 indexer3         pipeline.cc:219 I parse /home/shaikh/Documents/modern.c++/part1/chap2/2.1.2-type_conversions.cpp
17:02:15 indexer1         pipeline.cc:219 I parse /home/shaikh/Documents/modern.c++/part1/chap2/2.3.2-pointers.cpp
17:02:15 indexer0         pipeline.cc:219 I parse /home/shaikh/Documents/modern.c++/part1/chap2/2.3.3-compound_types.cpp
17:02:15 ccls         message_handler.cc:152 I "/home/shaikh/Documents/modern.c++/part1/chap2/2.4-const.cpp" is being indexed.

the test file 2.4-const.cpp has not been changed.

ccls package version

elpa/26.1/develop/ccls-20180708.1828

lsp-mode version

elpa/26.1/develop/lsp-mode-20180708.1914

maybe I could roll back the emacs packages. but I don't know how to downgrade a aur/ccls-gt package.
or should I build ccls by git and compiling the source code?

libclang: crash detected during parsing

Hello,

I am trying to use the ccls with emacs as a replacement for cquery, but it does not work at all. In different projects I always get libclang errors like this:

===-------------------------------------------------------------------------===                                                        
                         Miscellaneous Ungrouped Timers                                                                                
===-------------------------------------------------------------------------===                                                        
                                                                                                                                       
   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---                                                 
   0.0001 (100.0%)   0.0000 (100.0%)   0.0001 (100.0%)   0.0000 (100.0%)  scan include paths                                           
   0.0001 (100.0%)   0.0000 (100.0%)   0.0001 (100.0%)   0.0000 (100.0%)  Total                                                        
                                                                                                                                       
libclang: crash detected during parsing: {                                                                                             
  'source_filename' : '(null)'                                                                                                         
  'command_line_args' : ['/usr/bin/c++', '-I../doctest/doctest', '-I.', '-std=gnu++11', '-o', 'CMakeFiles/main.dir/BitStreamReader.cpp\
.o', '-c', '/home/sven/decoder2.0/BitStreamReader.cpp', '-resource-dir=/usr/lib/clang\
/6.0.0', '-working-directory=/home/sven/decoder2.0/build', '-Wno-unknown-warning-option', '-fparse-all-comments'],               
  'unsaved_files' : [],                                                                                                                
  'options' : 513,                                                                                                                     
}                                                                                                                                      
===-------------------------------------------------------------------------===                                                        
                         Miscellaneous Ungrouped Timers                                                                                
===-------------------------------------------------------------------------===                                                        
                                                                                                                                       
   ---Wall Time---  --- Name ---                                                                                                       
        -----       parse tu                                                                                                           
        -----       Total                                                                                                              
  • Manjaro Linux: current
  • ccls: 1606.c8a81ae-1
  • clang: clang version 6.0.0 (tags/RELEASE_600/final), Target: x86_64-pc-linux-gnu

With cquery the same setup is working properly.

cannot find system C++ header with ccls

image
system C header and Clang resource directory both complete fine:
image
image

Once I change all ccls in my configuration into cquery, C++ header can be also completed fine. So I think the problem arises from ccls

I have noticed this FAQ:

Set Initialization options "cacheFormat": "json" and run jq . < /tmp/ccls/@tmp@c/a.cc.json to see if -resource-dir is correct,

IIRC, (setq ccls-cache-dir ".ccls_cached_index") store the cache. Then I found in root of project(just 1 source file for test, but has cmake and compile_commands.json and cquery do work fine in this project) a .ccls_cached_index folder. There is two folder inseder, @@... and @.... In @@..., there is no json file, opposite filled with:

...
@usr@include@[email protected]@bits@predefined_ops.h.blob         @usr@[email protected]
@usr@include@[email protected]@bits@ptr_traits.h                  @usr@[email protected]
...

However in .cquery_cached_index/@@... folder, there are json files:

...
@usr@include@[email protected]@bits@predefined_ops.h              @usr@lib@gcc@[email protected]@[email protected]
@usr@include@[email protected]@bits@predefined_ops.h.json         @usr@lib@gcc@[email protected]@[email protected]

I don't if here is wrong.

From this link, I tried it on os:

@chenli-pc โžœ @@home@chenli@Dropbox@Demo@Graph@  clang++ -v -xc++ -E /dev/null    
clang version 6.0.0 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /bin
Found candidate GCC installation: /bin/../lib/gcc/x86_64-pc-linux-gnu/8.1.1
Found candidate GCC installation: /bin/../lib64/gcc/x86_64-pc-linux-gnu/8.1.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/8.1.1
Found candidate GCC installation: /usr/lib64/gcc/x86_64-pc-linux-gnu/8.1.1
Selected GCC installation: /bin/../lib64/gcc/x86_64-pc-linux-gnu/8.1.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
 "/usr/bin/clang-6.0" -cc1 -triple x86_64-pc-linux-gnu -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name null -mrelocation-model pic -pic-level 2 -pic-is-pie -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /usr/lib/clang/6.0.0 -internal-isystem /bin/../lib64/gcc/x86_64-pc-linux-gnu/8.1.1/../../../../include/c++/8.1.1 -internal-isystem /bin/../lib64/gcc/x86_64-pc-linux-gnu/8.1.1/../../../../include/c++/8.1.1/x86_64-pc-linux-gnu -internal-isystem /bin/../lib64/gcc/x86_64-pc-linux-gnu/8.1.1/../../../../include/c++/8.1.1/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib/clang/6.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /home/chenli/Dropbox/Demo/Graph/.ccls-cache/@@home@chenli@Dropbox@Demo@Graph@ -ferror-limit 19 -fmessage-length 167 -stack-protector 2 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o - -x c++ /dev/null
clang -cc1 version 6.0.0 based upon LLVM 6.0.0 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /bin/../lib64/gcc/x86_64-pc-linux-gnu/8.1.1/../../../../include/c++/8.1.1
 /bin/../lib64/gcc/x86_64-pc-linux-gnu/8.1.1/../../../../include/c++/8.1.1/x86_64-pc-linux-gnu
 /bin/../lib64/gcc/x86_64-pc-linux-gnu/8.1.1/../../../../include/c++/8.1.1/backward
 /usr/local/include
 /usr/lib/clang/6.0.0/include
 /usr/include
End of search list.
# 1 "/dev/null"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 394 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "/dev/null" 2

Any problem below?

I really want to become ccls user but this problem quite confuse me. Hope you can help me. Here is my configuration:

(setq ccls-executable "~/Downloads/ccls/Release/ccls")
(setq ccls-extra-args '("--log-file=/tmp/cq.log"))
(defun ccls//enable ()
   (condition-case nil
	(lsp-ccls-enable)
        (user-error nil)))
(add-hook 'c++-mode-hook #'ccls//enable)

(setq ccls-cache-dir ".ccls_cached_index")

(use-package ccls
   :requires (lsp-ui-flycheck lsp-ui-sideline)
   :ensure t
   :custom
   (company-lsp-async t)
   (ccls-extra-init-params '(:completion (:detailedLabel t)))
   (company-lsp-cache-candidates nil)
   (company-transformers nil)
   :config
   (setq ccls-sem-highlight-method 'font-lock)
   :after (company company-lsp)
   :commands (lsp-ccls-enable c++-mode))

Error suggestion

Hi,

19:27:39 comp-preload     clang_tu.cc:392 E libclang had ast read error for $file. Please try running the following, identify which flag causes the issue, and report a bug. ccls will then filter the flag for you  automatically.
c++ ...

It might be worth clarifying this should be clang++ in case c++ defaults to g++.

Does it work with Monaco?

Since Monaco editor and VS Code share the same core, and ccls works with VS Code, I wonder if ccls works with Monaco as well?

Thanks for this nice project.

[Feature request] Monaco editor support?

As Monaco editor is rising to a dominance status, I wonder if you have any plan to add some support to it, including adding some instructions on how to make ccls work with Monaco, just like what's done for VS Code?

Thanks for this awesome work!

C++ code completion suggests both private and public class members

When using code completion in neovim (through the LanguageClient-neovim plugin) with ccls, the completion suggestions on an object include both public and private members. For instance, given the class,

class A
{
  public:
    void myPublicFunction();

  private:
   void myPrivateFunction();
   int private_member_;
};

performing completion on an object a of class A shows myPublicFunction(), myPrivateFunction(), and private_member_ as completion suggestions. In practice, we can't call private members on an object. Is there a way for ccls to only provide completion suggestions for public members, or to note whether a member is public or private? This would be a really helpful addition to code completion.

failed to compile ccls in windows

PS E:\code\ccls> cmake . -BRelease
-- Building for: Visual Studio 15 2017
-- The CXX compiler identification is MSVC 19.14.26433.0
-- Check for working CXX compiler: d:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: d:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using downloaded Clang
-- Downloading Clang 6.0.1 (https://releases.llvm.org/6.0.1/LLVM-6.0.1-win64.exe) ...
-- 7-Zip not found in PATH
-- Downloading 7-Zip 1801 (https://www.7-zip.org/a/7z1801-x64.msi) ...
-- Extracting downloaded 7-Zip ...
-- Extracting downloaded Clang with 7-Zip ...
-- Could NOT find Clang (missing: Clang_LIBRARY LLVM_INCLUDE_DIR LLVM_BUILD_INCLUDE_DIR) (found suitable version "6.0.1", minimum required is "6.0.0")
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
-- Found Threads: TRUE
-- Configuring done
CMake Error at CMakeLists.txt:18 (add_executable):
Target "ccls" links to target "Clang::Clang" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?

CMake Error at CMakeLists.txt:18 (add_executable):
Target "ccls" links to target "Clang::Clang" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?

CMake Error at CMakeLists.txt:18 (add_executable):
Target "ccls" links to target "Clang::Clang" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?

CMake Error at CMakeLists.txt:18 (add_executable):
Target "ccls" links to target "Clang::Clang" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?

CMake Error at CMakeLists.txt:18 (add_executable):
Target "ccls" links to target "Clang::Clang" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?

-- Generating done
-- Build files have been written to: E:/code/ccls/rel

FR: C designated initializers

Hello, great work with this project, for me it's the holy grail of Vim autocompletion.

ISO C99 added "Designated Initializers": you can give the elements of a struct initializer in any order, by specifying the name of each field to initialize with .fieldname =. For example:

struct VkInstanceCreateInfo inst_info =
{
    .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
    .pNext = NULL,
    .flags = 0,
    //...
};

Since each undeclared field is initialized to 0, designated initializers are safer because they avoid undefined behavior caused by uninitialized fields. This feature is only in C.

These initializers are often a lifesaver for me. Would it be possible to add field completion for this?

Build ccls error "ld: library not found for -lc++experimental"

Hi, there,
I get the following error on Mac 10.13.5:
ld: library not found for -lc++experimental

commands to reproduce:

$git clone https://github.com/MaskRay/ccls.git
$cd ccls && mkdir build && cd build
$cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCLANG_USE_BUNDLED_LIBC++=on -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_LINK_FLAGS=-fuse-ld=lld ..
$make -j
...
[100%] Linking CXX executable ccls
ld: library not found for -lc++experimental
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [ccls] Error 1
make[2]: *** [CMakeFiles/ccls.dir/all] Error 2
make[1]: *** [CMakeFiles/ccls.dir/rule] Error 2
make: *** [ccls] Error 2

And the invocation of clang++ is:

/Users/john/projects/ccls/build/clang+llvm-6.0.0-x86_64-apple-darwin/bin/clang++  -O3 -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/ccls.dir/third_party/siphash.cc.o CMakeFiles/ccls.dir/src/clang_complete.cc.o CMakeFiles/ccls.dir/src/clang_tu.cc.o CMakeFiles/ccls.dir/src/clang_utils.cc.o CMakeFiles/ccls.dir/src/config.cc.o CMakeFiles/ccls.dir/src/file_consumer.cc.o CMakeFiles/ccls.dir/src/filesystem.cc.o CMakeFiles/ccls.dir/src/fuzzy_match.cc.o CMakeFiles/ccls.dir/src/main.cc.o CMakeFiles/ccls.dir/src/include_complete.cc.o CMakeFiles/ccls.dir/src/indexer.cc.o CMakeFiles/ccls.dir/src/method.cc.o CMakeFiles/ccls.dir/src/language.cc.o CMakeFiles/ccls.dir/src/log.cc.o CMakeFiles/ccls.dir/src/lsp.cc.o CMakeFiles/ccls.dir/src/match.cc.o CMakeFiles/ccls.dir/src/message_handler.cc.o CMakeFiles/ccls.dir/src/pipeline.cc.o CMakeFiles/ccls.dir/src/platform_posix.cc.o CMakeFiles/ccls.dir/src/platform_win.cc.o CMakeFiles/ccls.dir/src/position.cc.o CMakeFiles/ccls.dir/src/project.cc.o CMakeFiles/ccls.dir/src/query_utils.cc.o CMakeFiles/ccls.dir/src/query.cc.o CMakeFiles/ccls.dir/src/serializer.cc.o CMakeFiles/ccls.dir/src/test.cc.o CMakeFiles/ccls.dir/src/third_party_impl.cc.o CMakeFiles/ccls.dir/src/utils.cc.o CMakeFiles/ccls.dir/src/working_files.cc.o CMakeFiles/ccls.dir/src/messages/ccls_base.cc.o CMakeFiles/ccls.dir/src/messages/ccls_callHierarchy.cc.o CMakeFiles/ccls.dir/src/messages/ccls_callers.cc.o CMakeFiles/ccls.dir/src/messages/ccls_fileInfo.cc.o CMakeFiles/ccls.dir/src/messages/ccls_freshenIndex.cc.o CMakeFiles/ccls.dir/src/messages/ccls_inheritanceHierarchy.cc.o CMakeFiles/ccls.dir/src/messages/ccls_memberHierarchy.cc.o CMakeFiles/ccls.dir/src/messages/ccls_vars.cc.o CMakeFiles/ccls.dir/src/messages/exit.cc.o CMakeFiles/ccls.dir/src/messages/initialize.cc.o CMakeFiles/ccls.dir/src/messages/shutdown.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_codeLens.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_completion.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_definition.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_didChange.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_didClose.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_didOpen.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_didSave.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_documentHighlight.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_documentSymbol.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_hover.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_implementation.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_references.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_rename.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_signatureHelp.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_typeDefinition.cc.o CMakeFiles/ccls.dir/src/messages/workspace_didChangeConfiguration.cc.o CMakeFiles/ccls.dir/src/messages/workspace_didChangeWatchedFiles.cc.o CMakeFiles/ccls.dir/src/messages/workspace_symbol.cc.o  -o ccls -Wl,-rpath,/Users/john/projects/ccls/build/clang+llvm-6.0.0-x86_64-apple-darwin/lib clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclang.dylib -lc++experimental clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangFrontend.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangParse.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangSerialization.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangSema.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangAnalysis.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangEdit.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangAST.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangLex.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangDriver.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangBasic.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMMCParser.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMMC.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMBitReader.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMOption.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMProfileData.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMCore.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMBinaryFormat.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMSupport.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMDemangle.a /usr/lib/libcurses.dylib /usr/lib/libform.dylib /usr/lib/libz.dylib

And add -L/Users/john/projects/ccls/build/clang+llvm-6.0.0-x86_64-apple-darwin/lib to above command can solve the issue.

The modified command is:

/Users/john/projects/ccls/build/clang+llvm-6.0.0-x86_64-apple-darwin/bin/clang++  -O3 -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/ccls.dir/third_party/siphash.cc.o CMakeFiles/ccls.dir/src/clang_complete.cc.o CMakeFiles/ccls.dir/src/clang_tu.cc.o CMakeFiles/ccls.dir/src/clang_utils.cc.o CMakeFiles/ccls.dir/src/config.cc.o CMakeFiles/ccls.dir/src/file_consumer.cc.o CMakeFiles/ccls.dir/src/filesystem.cc.o CMakeFiles/ccls.dir/src/fuzzy_match.cc.o CMakeFiles/ccls.dir/src/main.cc.o CMakeFiles/ccls.dir/src/include_complete.cc.o CMakeFiles/ccls.dir/src/indexer.cc.o CMakeFiles/ccls.dir/src/method.cc.o CMakeFiles/ccls.dir/src/language.cc.o CMakeFiles/ccls.dir/src/log.cc.o CMakeFiles/ccls.dir/src/lsp.cc.o CMakeFiles/ccls.dir/src/match.cc.o CMakeFiles/ccls.dir/src/message_handler.cc.o CMakeFiles/ccls.dir/src/pipeline.cc.o CMakeFiles/ccls.dir/src/platform_posix.cc.o CMakeFiles/ccls.dir/src/platform_win.cc.o CMakeFiles/ccls.dir/src/position.cc.o CMakeFiles/ccls.dir/src/project.cc.o CMakeFiles/ccls.dir/src/query_utils.cc.o CMakeFiles/ccls.dir/src/query.cc.o CMakeFiles/ccls.dir/src/serializer.cc.o CMakeFiles/ccls.dir/src/test.cc.o CMakeFiles/ccls.dir/src/third_party_impl.cc.o CMakeFiles/ccls.dir/src/utils.cc.o CMakeFiles/ccls.dir/src/working_files.cc.o CMakeFiles/ccls.dir/src/messages/ccls_base.cc.o CMakeFiles/ccls.dir/src/messages/ccls_callHierarchy.cc.o CMakeFiles/ccls.dir/src/messages/ccls_callers.cc.o CMakeFiles/ccls.dir/src/messages/ccls_fileInfo.cc.o CMakeFiles/ccls.dir/src/messages/ccls_freshenIndex.cc.o CMakeFiles/ccls.dir/src/messages/ccls_inheritanceHierarchy.cc.o CMakeFiles/ccls.dir/src/messages/ccls_memberHierarchy.cc.o CMakeFiles/ccls.dir/src/messages/ccls_vars.cc.o CMakeFiles/ccls.dir/src/messages/exit.cc.o CMakeFiles/ccls.dir/src/messages/initialize.cc.o CMakeFiles/ccls.dir/src/messages/shutdown.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_codeLens.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_completion.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_definition.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_didChange.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_didClose.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_didOpen.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_didSave.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_documentHighlight.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_documentSymbol.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_hover.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_implementation.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_references.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_rename.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_signatureHelp.cc.o CMakeFiles/ccls.dir/src/messages/textDocument_typeDefinition.cc.o CMakeFiles/ccls.dir/src/messages/workspace_didChangeConfiguration.cc.o CMakeFiles/ccls.dir/src/messages/workspace_didChangeWatchedFiles.cc.o CMakeFiles/ccls.dir/src/messages/workspace_symbol.cc.o  -o ccls -Wl,-v -Wl,-rpath,/Users/john/projects/ccls/build/clang+llvm-6.0.0-x86_64-apple-darwin/lib -L/Users/john/projects/ccls/build/clang+llvm-6.0.0-x86_64-apple-darwin/lib clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclang.dylib -lc++experimental clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangFrontend.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangParse.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangSerialization.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangSema.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangAnalysis.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangEdit.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangAST.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangLex.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangDriver.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libclangBasic.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMMCParser.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMMC.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMBitReader.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMOption.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMProfileData.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMCore.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMBinaryFormat.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMSupport.a clang+llvm-6.0.0-x86_64-apple-darwin/lib/libLLVMDemangle.a /usr/lib/libcurses.dylib /usr/lib/libform.dylib /usr/lib/libz.dylib

HOWTO: Programmatically pre-index?

I have large codebases to index, I am happy this is supported at runtime but I'd like to precompile. Also I'm not sure how dereferencing would work adhoc. How should I do this?

Is there any need for modern-c++-font-lock-mode?

Hello, I just started using ccls a few weeks ago and I was wondering is there any need for modern-c++-font-lock-mode since ccls also takes care of semantic highlighting using font-lock (does this also support all the latest C++17 stuff)?

Indexing fails on compilation database using 'arguments:' for command line

New user here, could be something I'm doing wrong. I'm using ccls with Emacs on macOS. I built ccls from github clone and installed it in /usr/local/bin. I installed emacs-ccls and lsp-mode packages for Emacs.

When I call M-x lsp-ccls-enable on a project file, it picks up the compilation database fine. The database was generated from clang -MJ option, and it uses "arguments:" key instead of "command:" for the compile command. When the indexer attempts to run on the visited file, it fails reporting a bunch of Error lines in *Messages*. Checking *lsp-ccls stderr* it's reporting an error from clang:

error: unable to handle compilation, expected exactly one compiler job in ' "/path/to/clang" "-cc1" <rest of compile args> ; '

where <rest of compile args> is the rather long set of compile options I've used, omitted for brevity.

Maybe clang is expecting the arguments to be joined into a single command? This would look more like the "command:" key that is the alternative option for the compile db.

Occur error during build.

My system is Ubuntu16.04, I'm trying build ccls as getting started. When I run cmake -H. -Brelease , I got these:

-- Using downloaded Clang
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindCurses.cmake:206 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  cmake/FindClang.cmake:120 (find_package)
  cmake/DownloadAndExtractClang.cmake:45 (find_package)
  CMakeLists.txt:86 (download_and_extract_clang)

What should I do?

Memory requirements.

I am investigating various C/C++ language servers (LS), including ccls. As we are going to run the LS in a memory constrained environment, memory consumption is an important criteria for us when choosing from candidate LS'es.

Suppose I have a setup like this: I have installed standard g++/STL, along with Boost library. How much memory is consumed when ccls parses a simple C/Cpp/ObjC file handling LSP requests, consisting no more than a few hundred lines of code?

I assume indexed files derived from C standard library/STL/Boost are loaded when parsing the client's file, how much memory is required for the indexed files? What if I run multiple ccls instances on one single machine, are these files shared by all the instances, or each instance has to load a copy of these index files?

Thank you.

ccls SIGSEGV (due to ABI mismatch) when linking against clang+llvm-[67].0.0-x86_64-linux-gnu-ubuntu-14.04

Thread 1 "ccls" received signal SIGSEGV, Segmentation fault.
0x00000000007f494a in std::string::_Rep::_M_is_leaked (this=0xffffffffffffffe8) at /opt/rh/devtoolset-7/root/usr/include/c++/7/bits/basic_string.h:3171
3171              return __atomic_load_n(&this->_M_refcount, __ATOMIC_RELAXED) < 0;
(gdb) bt
#0  0x00000000007f494a in std::string::_Rep::_M_is_leaked (this=0xffffffffffffffe8) at /opt/rh/devtoolset-7/root/usr/include/c++/7/bits/basic_string.h:3171
#1  0x00000000007ef389 in std::string::swap (this=0x48aba10, __s="") at /opt/rh/devtoolset-7/root/usr/include/c++/7/bits/basic_string.tcc:971
#2  0x00000000009f16d5 in ParseFrontendArgs(clang::FrontendOptions&, llvm::opt::ArgList&, clang::DiagnosticsEngine&, bool&) ()
#3  0x00000000009eab75 in clang::CompilerInvocation::CreateFromArgs(clang::CompilerInvocation&, char const* const*, char const* const*, clang::DiagnosticsEngine&) ()
#4  0x00000000008b8d86 in (anonymous namespace)::ProjectProcessor::Process (this=0x7ffdc83d6bc0, entry=...) at /data/developer/ccls/src/project.cc:167
#5  0x00000000008ba991 in (anonymous namespace)::LoadEntriesFromDirectory (project=0x7ffdc83d7330, opt_compdb_dir="") at /data/developer/ccls/src/project.cc:332
#6  0x00000000008bafed in Project::Load (this=0x7ffdc83d8d10, root_directory="/data/developer/icp/") at /data/developer/ccls/src/project.cc:363
#7  0x0000000000935545 in (anonymous namespace)::Handler_Initialize::Run (this=0x1f7d400 <(anonymous namespace)::Handler_Initializemessage_handler_instance_>, request=0x7f9994000b40)
    at /data/developer/ccls/src/messages/initialize.cc:484
#8  0x0000000000939d86 in BaseMessageHandler<(anonymous namespace)::In_InitializeRequest>::Run (this=0x1f7d400 <(anonymous namespace)::Handler_Initializemessage_handler_instance_>,
    message=std::unique_ptr<InMessage> containing 0x7f9994000b40) at /data/developer/ccls/src/message_handler.h:142
#9  0x00000000008a21a9 in ccls::pipeline::MainLoop () at /data/developer/ccls/src/pipeline.cc:470
#10 0x000000000081bf1e in main (argc=2, argv=0x7ffdc83d9388) at /data/developer/ccls/src/main.cc:134

I'm using the ubuntu 14.04 clang rather than 16.04 per #70, which I suppose might be relevant.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.