* In the "initialized" callback, send client/registerCapability with DidChangeWatchedFilesRegistrationOptions
* In workspace/didChangeWatchedFiles callback, call pipeline::Index
* In pipeline::Index, add a `deleted` status
* Add %h for C header files (the suffix .h is considered a C header, not a C++ header)
* Add %hpp for C++ header files
* If .ccls exists, it provides full command line for files not specified by compile_commands.json (before, compile_commands.json was ignored)
* If the first line of .ccls is %compile_commands.json, it appends flags to compile_commands.json "arguments", instead of overriding.
Files not specified by compile_commands.json will not be added to folder.entries, but their command line can be inferred from other files.
Also fix `#include <` completion of -I flags for clang < 8
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.
textDocument/{declaration,definition,typeDefinition} return either LocationLink[] or Location[]
Add an initialization option client.linkSupport . When it is false, ccls will return Location[] disregarding client's linkSupport.
`struct LocationLink` does not include originSelectionRange as it is wasteful.
Initialization options are applied (deserialized to the same object) in the following order:
* "initializationOptions" from client
* first -init=
* second -init=
* ...
Scalar options will be overridden but arrays will get concatenated, e.g.
ccls -log-file=/dev/stderr -index . -init='{"clang":{"extraArgs":["-DA"]}}' -init='{"clang":{"extraArgs":["-DB"]}}'
results in clang.extraArgs: ["-DA", "-DB"]
* 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.
This works around gcc 7.2/clang rC347417 which have a bad interaction with libstdc++'s implementation of P0426
constexpr std::string_view also emits a string_view object in .rodata that cannot be optimized out by clang (which means larger object file size)
So use good old const.
It decreases Content-Length: from 32K to 25K for the following case:
#include <bits/stdc++.h>
int main() { std::| }
Also
* make results deterministic when completion text is empty
* sort by newText, label, filterText