[clangd][NFC] Fix formatting in ClangdLSPServer

This commit is contained in:
Kadir Cetinkaya 2020-10-12 14:24:05 +02:00
parent 01dc85c173
commit 9407686687
No known key found for this signature in database
GPG Key ID: E39E36B8D2057ED6
1 changed files with 15 additions and 16 deletions

View File

@ -1049,22 +1049,21 @@ void ClangdLSPServer::onCompletion(const CompletionParams &Params,
vlog("ignored auto-triggered completion, preceding char did not match");
return Reply(CompletionList());
}
Server->codeComplete(Params.textDocument.uri.file(), Params.position,
Opts.CodeComplete,
[Reply = std::move(Reply),
this](llvm::Expected<CodeCompleteResult> List) mutable {
if (!List)
return Reply(List.takeError());
CompletionList LSPList;
LSPList.isIncomplete = List->HasMore;
for (const auto &R : List->Completions) {
CompletionItem C = R.render(Opts.CodeComplete);
C.kind = adjustKindToCapability(
C.kind, SupportedCompletionItemKinds);
LSPList.items.push_back(std::move(C));
}
return Reply(std::move(LSPList));
});
Server->codeComplete(
Params.textDocument.uri.file(), Params.position, Opts.CodeComplete,
[Reply = std::move(Reply),
this](llvm::Expected<CodeCompleteResult> List) mutable {
if (!List)
return Reply(List.takeError());
CompletionList LSPList;
LSPList.isIncomplete = List->HasMore;
for (const auto &R : List->Completions) {
CompletionItem C = R.render(Opts.CodeComplete);
C.kind = adjustKindToCapability(C.kind, SupportedCompletionItemKinds);
LSPList.items.push_back(std::move(C));
}
return Reply(std::move(LSPList));
});
}
void ClangdLSPServer::onSignatureHelp(const TextDocumentPositionParams &Params,