Commit 5db340c7 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

allow id field to be a string => convert to int from string

this allows to e.g. work with the Perl LSP server

should have no negative effects for standard conform servers
there the same code path is used as before
parent 09336ebe
......@@ -922,7 +922,13 @@ private:
// check if it is the expected result
int msgid = -1;
if (result.contains(MEMBER_ID)) {
msgid = result[MEMBER_ID].toInt();
// allow id to be returned as a string value, happens e.g. for Perl LSP server
const auto idValue = result[MEMBER_ID];
if (idValue.isString()) {
msgid = idValue.toString().toInt();
} else {
msgid = idValue.toInt();
}
} else {
processNotification(result);
continue;
......@@ -946,7 +952,7 @@ private:
handler(result.value(MEMBER_RESULT));
} else {
// could have been canceled
qCDebug(LSPCLIENT) << "unexpected reply id";
qCDebug(LSPCLIENT) << "unexpected reply id" << msgid;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment