in Source/RiderSourceCodeAccess/Private/RiderPathLocator/Common/RiderPathLocator.cpp [65:89]
FVersion FRiderPathLocator::GetLastBuildVersion(const FString& HistoryJsonPath)
{
if(!FPaths::FileExists(HistoryJsonPath)) return {};
FString JsonStr;
FFileHelper::LoadFileToString(JsonStr, *HistoryJsonPath);
const TSharedRef<TJsonReader<TCHAR>> JsonReader = TJsonReaderFactory<TCHAR>::Create(JsonStr);
TSharedPtr<FJsonObject> JsonObject = MakeShareable(new FJsonObject());
if (!FJsonSerializer::Deserialize(JsonReader, JsonObject) || !JsonObject.IsValid()) return {};
const TArray< TSharedPtr<FJsonValue> >* HistoryField;
if(!JsonObject->TryGetArrayField(TEXT("history"), HistoryField)) return {};
if(HistoryField->Num() == 0) return {};
const TSharedPtr<FJsonObject>* LastItemObject;
if(!HistoryField->Last()->TryGetObject(LastItemObject)) return {};
const TSharedPtr<FJsonObject>* ItemObject;
if(!LastItemObject->Get()->TryGetObjectField("item", ItemObject)) return {};
FString Build;
if(!ItemObject->Get()->TryGetStringField("build", Build)) return {};
return FVersion(Build);
}