Make missing clientVersion skip check

This commit is contained in:
Jacob Dufault 2017-12-04 00:29:38 -08:00
parent 670c925204
commit 0f3680866e
2 changed files with 6 additions and 5 deletions

View File

@ -1511,13 +1511,13 @@ bool QueryDbMainLoop(Config* config,
*config = *request->params.initializationOptions;
// Check client version.
if (config->clientVersion != kExpectedClientVersion &&
config->clientVersion != -1 /*disable check*/) {
if (config->clientVersion.has_value() &&
*config->clientVersion != kExpectedClientVersion) {
Out_ShowLogMessage out;
out.display_type = Out_ShowLogMessage::DisplayType::Show;
out.params.type = lsMessageType::Error;
out.params.message =
"cquery client (v" + std::to_string(config->clientVersion) +
"cquery client (v" + std::to_string(*config->clientVersion) +
") and server (v" + std::to_string(kExpectedClientVersion) +
") version mismatch. Please update ";
if (config->clientVersion > kExpectedClientVersion)

View File

@ -67,8 +67,9 @@ struct Config {
// Enables code lens on parameter and function variables.
bool codeLensOnLocalVariables = true;
// Version of the client.
int clientVersion = 0;
// Version of the client. If undefined the version check is skipped. Used to
// inform users their vscode client is too old and needs to be updated.
optional<int> clientVersion;
// If true parameter declarations are included in code completion when calling
// a function or method