mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-29 02:51:57 +00:00
early return and add a comment
This commit is contained in:
parent
e55cc6865c
commit
5d401fc95d
@ -27,26 +27,28 @@ REFLECT_STRUCT(SymbolInformation, name, kind, location, containerName);
|
||||
|
||||
void MessageHandler::workspace_didChangeConfiguration(JsonReader &reader) {
|
||||
auto it = reader.m->FindMember("settings");
|
||||
if (it != reader.m->MemberEnd() && it->value.IsObject()) {
|
||||
rapidjson::StringBuffer output;
|
||||
rapidjson::Writer<rapidjson::StringBuffer> writer(output);
|
||||
JsonReader m1(&it->value);
|
||||
it->value.Accept(writer);
|
||||
LOG_S(INFO) << "didChangeConfiguration: " << output.GetString();
|
||||
try {
|
||||
reflect(m1, *g_config);
|
||||
} catch (std::invalid_argument &) {
|
||||
reader.path_.push_back("settings");
|
||||
reader.path_.insert(reader.path_.end(), m1.path_.begin(), m1.path_.end());
|
||||
throw;
|
||||
}
|
||||
if (!(it != reader.m->MemberEnd() && it->value.IsObject()))
|
||||
return;
|
||||
|
||||
for (auto &[folder, _] : g_config->workspaceFolders)
|
||||
project->load(folder);
|
||||
project->index(wfiles, RequestId());
|
||||
|
||||
manager->clear();
|
||||
// Similar to MessageHandler::initialize.
|
||||
rapidjson::StringBuffer output;
|
||||
rapidjson::Writer<rapidjson::StringBuffer> writer(output);
|
||||
JsonReader m1(&it->value);
|
||||
it->value.Accept(writer);
|
||||
LOG_S(INFO) << "didChangeConfiguration: " << output.GetString();
|
||||
try {
|
||||
reflect(m1, *g_config);
|
||||
} catch (std::invalid_argument &) {
|
||||
reader.path_.push_back("settings");
|
||||
reader.path_.insert(reader.path_.end(), m1.path_.begin(), m1.path_.end());
|
||||
throw;
|
||||
}
|
||||
|
||||
for (auto &[folder, _] : g_config->workspaceFolders)
|
||||
project->load(folder);
|
||||
project->index(wfiles, RequestId());
|
||||
|
||||
manager->clear();
|
||||
}
|
||||
|
||||
void MessageHandler::workspace_didChangeWatchedFiles(
|
||||
|
Loading…
Reference in New Issue
Block a user