https://github.com/MaskRay/ccls/blob/master/src/main.cc#L90 is not
relyable because `1` and `2` are out of range of `enum Verbosity`.
According to CWG 1766:
> A value of integral or enumeration type can be explicitly converted to an enumeration type. The value is unchanged if the original value is within the range of the enumeration values (10.2 [dcl.enum]). Otherwise, the resulting value is unspecified (and might not be in that range) behavior is undefined.
so, stuff like LOG_V(1) and LOG_V(2) are UB. The solution is either:
Message(Verbosity verbosity, const char* file, int line); -> Message(int verbosity, const char* file, int line);
or
```c++
enum Verbosity {
Verbosity_FATAL = -3,
Verbosity_ERROR = -2,
Verbosity_WARNING = -1,
Verbosity_INFO = 0,
// more level...
};
```
IMO the latter is better option.
This pr also replace macros inside log.hh with short functions and
replace `enum Verbosity` with `enum class Verbosity`
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/.
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 the "initialized" callback, send client/registerCapability with DidChangeWatchedFilesRegistrationOptions
* In workspace/didChangeWatchedFiles callback, call pipeline::Index
* In pipeline::Index, add a `deleted` status
In completion, underscore prefixed builtin macros may be annoying when the first type character is not an underscore.
When `strict` is true, `Match` enforces the first characters should be loosely of the same category.
* WorkingFiles::files : vector -> unordered_map
* Add timestamp to WorkingFile
* Rename "comp-preload" thread to "preamble"
* Rename CompletionManager to SemaManager as it is used by "diag" "comp" "preamble"
* Rename clang_complete.* to sema_manager.*
* Merge SemaManager::{preloads,sessions}
* Add initialization option session.maxNum
* In DiagnosticMain, if an included file was modified, cancel the DiagTask and create a PreambleTask instead. The task sets `from_diag` so as to trigger immediate DiagTask after the preamble is built.