diff options
| author | Alex Lorenz <arphaman@gmail.com> | 2018-08-01 17:39:29 +0000 |
|---|---|---|
| committer | Alex Lorenz <arphaman@gmail.com> | 2018-08-01 17:39:29 +0000 |
| commit | f808786a6543b7a00e3b51da5b27ce57fce0db6f (patch) | |
| tree | 1b040d6330e0d24b4c23f21e5c7f22d44c4a9827 /clang-tools-extra/clangd/Protocol.h | |
| parent | f6d1923c8640c7931c51a7b8254663c23835924e (diff) | |
| download | bcm5719-llvm-f808786a6543b7a00e3b51da5b27ce57fce0db6f.tar.gz bcm5719-llvm-f808786a6543b7a00e3b51da5b27ce57fce0db6f.zip | |
[clangd] allow clients to control the compilation database by passing in
compilationDatabaseChanges in the 'workspace/didChangeConfiguration' request
This commit allows clangd to use an in-memory compilation database that's
controlled from the LSP client (-compile_args_from=lsp). It extends the
'workspace/didChangeConfiguration' request to allow the client to pass in a
compilation database subset that needs to be updated in the workspace.
Differential Revision: https://reviews.llvm.org/D49758
llvm-svn: 338597
Diffstat (limited to 'clang-tools-extra/clangd/Protocol.h')
| -rw-r--r-- | clang-tools-extra/clangd/Protocol.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/Protocol.h b/clang-tools-extra/clangd/Protocol.h index 7f33976dedb..5056dbef8ee 100644 --- a/clang-tools-extra/clangd/Protocol.h +++ b/clang-tools-extra/clangd/Protocol.h @@ -322,11 +322,25 @@ struct ClientCapabilities { bool fromJSON(const llvm::json::Value &, ClientCapabilities &); +/// Clangd extension that's used in the 'compilationDatabaseChanges' in +/// workspace/didChangeConfiguration to record updates to the in-memory +/// compilation database. +struct ClangdCompileCommand { + std::string workingDirectory; + std::vector<std::string> compilationCommand; +}; +bool fromJSON(const llvm::json::Value &, ClangdCompileCommand &); + /// Clangd extension to set clangd-specific "initializationOptions" in the /// "initialize" request and for the "workspace/didChangeConfiguration" /// notification since the data received is described as 'any' type in LSP. struct ClangdConfigurationParamsChange { llvm::Optional<std::string> compilationDatabasePath; + + // The changes that happened to the compilation database. + // The key of the map is a file name. + llvm::Optional<std::map<std::string, ClangdCompileCommand>> + compilationDatabaseChanges; }; bool fromJSON(const llvm::json::Value &, ClangdConfigurationParamsChange &); |

