The interface used is now tooling::CompilationDatabase.
The various behaviors of the existing CDB implementation is decomposed into
several classes responsible for one aspect each.
- The fallback commands are now a FixedCompilationDatabase. For now, this is done by both ClangdLSPServer and ClangdServer (preserving behavior) but I'd like to eliminate the latter, as embedders of ClangdServer are in a better position to know what fallback is appropriate.
- the fallback now uses '.' as the directory, rather than the file's parent.
- The compilation database file scan caches missing as well as present files.
- -fsyntax-only is now applied to all commands, not just the fallback. We also string output flags.
- The final command line used for each file is now logged.
- The -resource-dir flag is managed by ClangdServer rather than being done deeper in the stack. All flag manipulation is done by CDBs set up by ClangdLSPServer and ClangdServer.
- Race in extra-flags fixed: when reading extra flags for a file we now lock the map
Clangd still changes working directory when running the parsing, so "." might end up being a different dir on multiple runs over the same file.
Maybe use file's parent for now?