mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-07 16:42:34 +00:00
[clangd] Fix -compile-commands-dir flag, broken in r345031
llvm-svn: 345232
This commit is contained in:
parent
fd7d341b43
commit
4b86bb04fa
@ -303,7 +303,6 @@ void ClangdLSPServer::onInitialize(const InitializeParams &Params,
|
||||
if (Server)
|
||||
return Reply(make_error<LSPError>("server already initialized",
|
||||
ErrorCode::InvalidRequest));
|
||||
Optional<Path> CompileCommandsDir;
|
||||
if (Params.initializationOptions)
|
||||
CompileCommandsDir = Params.initializationOptions->compilationDatabasePath;
|
||||
CDB.emplace(UseInMemoryCDB
|
||||
@ -696,7 +695,9 @@ ClangdLSPServer::ClangdLSPServer(class Transport &Transp,
|
||||
: Transp(Transp), MsgHandler(new MessageHandler(*this)), CCOpts(CCOpts),
|
||||
SupportedSymbolKinds(defaultSymbolKinds()),
|
||||
SupportedCompletionItemKinds(defaultCompletionItemKinds()),
|
||||
UseInMemoryCDB(ShouldUseInMemoryCDB), ClangdServerOpts(Opts) {
|
||||
UseInMemoryCDB(ShouldUseInMemoryCDB),
|
||||
CompileCommandsDir(std::move(CompileCommandsDir)),
|
||||
ClangdServerOpts(Opts) {
|
||||
// clang-format off
|
||||
MsgHandler->bind("initialize", &ClangdLSPServer::onInitialize);
|
||||
MsgHandler->bind("shutdown", &ClangdLSPServer::onShutdown);
|
||||
|
@ -169,6 +169,7 @@ private:
|
||||
|
||||
// The CDB is created by the "initialize" LSP method.
|
||||
bool UseInMemoryCDB; // FIXME: make this a capability.
|
||||
llvm::Optional<Path> CompileCommandsDir; // FIXME: merge with capability?
|
||||
llvm::Optional<CompilationDB> CDB;
|
||||
// The ClangdServer is created by the "initialize" LSP method.
|
||||
// It is destroyed before run() returns, to ensure worker threads exit.
|
||||
|
Loading…
Reference in New Issue
Block a user