LanguageClient: avoid optional::value

Potentially throws std::bad_optional_access. Use operator* and
operator-> instead.

Change-Id: Idefa137da53f3663ea88961f1105b93402ec4777
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
David Schulz
2022-02-24 09:38:59 +01:00
parent 41538832c3
commit 4452f71201
21 changed files with 110 additions and 121 deletions

View File

@@ -103,7 +103,7 @@ IAssistProposal *FunctionHintProcessor::perform(const AssistInterface *interface
void FunctionHintProcessor::cancel()
{
if (running()) {
m_client->cancelRequest(m_currentRequest.value());
m_client->cancelRequest(*m_currentRequest);
m_client->removeAssistProcessor(this);
m_currentRequest.reset();
}
@@ -113,7 +113,7 @@ void FunctionHintProcessor::handleSignatureResponse(const SignatureHelpRequest::
{
m_currentRequest.reset();
if (auto error = response.error())
m_client->log(error.value());
m_client->log(*error);
m_client->removeAssistProcessor(this);
auto result = response.result().value_or(LanguageClientValue<SignatureHelp>());
if (result.isNull()) {