This commit adds additional logic to only add the headers of LLVM, clang and
rapidjson if they are not already in the compiler's default search path.
The issue was, that adding the same folder via:
target_include_directories(tgt SYSTEM ${foo})
results in the following invocation of gcc:
gcc -isystem $foo ...
which causes issues with libstdc++ shipped by gcc9. libstdc++ makes use of
#include_next for some internal trickery, but that changes the way headers are
resolved and causes compilation failures because standard headers are now
suddenly missing.
With this commit we now check each of the extra include directories if they are
already in the compiler's search path. If they are, we don't add them and
circumvent this issue.
Note with -fretain-comments-from-system-headers, the .gch of bits/stdc++.h becomes larger by 1%, but that is fine.
And improve comment handling in textDocument/hover
Fix#373
By default, the background indexer doesn't handle names of no linkage.
They are indexed when their files are opened. This saves memory and
makes cache files smaller.
If the workspace folder is a symlink and the client doesn't follow it.
Treat /tmp/symlink/ as canonical and convert every /tmp/real/ path to
/tmp/symlink/.
Combined Daan De Meyer's #227 with other simplification
* USE_SHARED_LLVM is deleted in favor of LLVM_LINK_LLVM_DYLIB
* LLVM_ENABLE_RTTI is deleted as it is provided by LLVMConfig.cmake
* Only direct Clang/LLVM dependencies are required in target_link_libraries
* Restrict -DCLANG_RESOURCE_DIRECTORY= to src/utils.cc
cache.hierarchicalPath: store cache files as $directory/a/b/c.cc.blob to
work around NAME_MAX limitation.
cache.retainInMemory: after this number of loads, keep a copy of file
index in memory. If set to 1, it avoids cache corruption if the index
file is changed after the initial load, which may happen if several
language clients open the same project and share the same cache
directory.
Also rename cacheDirectory cacheFormat to cache.{directory,format}
In clients that support DiagnosticRelatedInformation, display
clang notes as these nested diagnostics rather than appending
them to the parent diagnostic's message. Behaviour for clients
that don't support related information should be unchanged.
indexer.cc: use index.maxInitializerLines instead of kInitializerMaxLines
messages/initialize.cc: some ServerCapabilities are toggable:
documentOnTypeFormattingProvider.firstTriggerCharacter
foldingRangeProvider
workspace.workspaceFolders.supported
Fix#190
If a new header is added, the preamble size changes. Language clients may cache completion results, thus we rebuild preamble to avoid inaccurate results.