#include "data_language_json.h" #include #include namespace NSQLHighlight { TVector LoadTypes() { TString resource = NResource::Find("types.json"); NJson::TJsonValue json = NJson::ReadJsonFastTree(resource); TVector types; for (const NJson::TJsonValue& value : json.GetArraySafe()) { types.emplace_back(value["name"].GetStringSafe()); } return types; } TVector LoadHints() { TString resource = NResource::Find("statements_opensource.json"); NJson::TJsonValue json = NJson::ReadJsonFastTree(resource); TVector hints; for (const auto& [statement, services] : json.GetMapSafe()) { for (const auto& [service, kinds] : services.GetMapSafe()) { for (const auto& hint : kinds["hints"].GetArraySafe()) { hints.emplace_back(hint["name"].GetStringSafe()); } } } return hints; } } // namespace NSQLHighlight