LSP: simplify request response type

Instead of always defining the templates of the response type by hand
add a using construct in the Request where all the template types are
known.

Change-Id: I0dc00bd9aef9c37c9454e35aca200a30fcf2ebda
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2018-11-20 07:45:22 +01:00
parent f73ed6bb54
commit e52ea7771f
8 changed files with 17 additions and 22 deletions

View File

@@ -324,7 +324,7 @@ void LanguageClientManager::findLinkAt(const Utils::FileName &filePath,
const Position pos(cursor);
TextDocumentPositionParams params(document, pos);
GotoDefinitionRequest request(params);
request.setResponseCallback([callback](const Response<GotoResult, LanguageClientNull> &response){
request.setResponseCallback([callback](const GotoDefinitionRequest::Response &response){
if (Utils::optional<GotoResult> _result = response.result()) {
const GotoResult result = _result.value();
if (Utils::holds_alternative<std::nullptr_t>(result))