This patch is based on https://reviews.llvm.org/D49523.
It extends the 'workspace/didChangeConfiguration' request to allow us to pass in a compilation database subset that we would like to update in the workspace.
Differential D49758
[clangd] allow clients to pass in compilationDatabaseChanges in the 'workspace/didChangeConfiguration' request arphaman on Jul 24 2018, 1:59 PM. Authored by
Details
This patch is based on https://reviews.llvm.org/D49523. It extends the 'workspace/didChangeConfiguration' request to allow us to pass in a compilation database subset that we would like to update in the workspace.
Diff Detail Event TimelineComment Actions The mode of operation where compile commands come from the client seems useful, but I wonder if there's any value in mixing it with compile_commands.json and other CDB plugins.
Comment Actions The client will control the commands exclusively.
Comment Actions Maybe a cleaner design would be to untangle the two use-cases and control them with a flag to clangd?
The command-line arg to clangd will control which implementation is used. The advantage is that we don't have to think about interactions between the clang plugins and explicit overrides and it should be easier to make sure that we don't accidentally read compilation args from the wrong place.
Comment Actions Sounds good to me. I'll update the patch to do that. Comment Actions Updated patch to address review comments:
Comment Actions Address review comments
Comment Actions Just a few nits left.
Comment Actions Updated to address review comments.
|
This code starts to be a little hard to follow. Could we extract it into an external class that encapsulates this logic? Something like:
We can static_cast to InMemoryCDB or DirectoryBasedCDB based on the IsDirectoryBased flag to implement all the operations we define in the helper class.