in Source/RiderSourceCodeAccess/Private/RiderPathLocator/Linux/RiderPathLocatorLinux.cpp [22:61]
TOptional<FInstallInfo> FRiderPathLocator::GetInstallInfoFromRiderPath(const FString& Path, FInstallInfo::EInstallType InstallType)
{
if(!FPaths::FileExists(Path))
{
return {};
}
const FString PatternString(TEXT("(.*)(?:\\\\|/)bin"));
const FRegexPattern Pattern(PatternString);
FRegexMatcher RiderPathMatcher(Pattern, Path);
if (!RiderPathMatcher.FindNext())
{
return {};
}
const FString RiderDir = RiderPathMatcher.GetCaptureGroup(1);
const FString RiderCppPluginPath = FPaths::Combine(RiderDir, TEXT("plugins"), TEXT("rider-cpp"));
if (!DirectoryExistsAndNonEmpty(RiderCppPluginPath))
{
return {};
}
FInstallInfo Info;
Info.Path = Path;
Info.InstallType = InstallType;
const FString ProductInfoJsonPath = FPaths::Combine(RiderDir, TEXT("product-info.json"));
if (FPaths::FileExists(ProductInfoJsonPath))
{
ParseProductInfoJson(Info, ProductInfoJsonPath);
}
if(!Info.Version.IsInitialized())
{
Info.Version = FPaths::GetBaseFilename(RiderDir);
if(Info.Version.Major() >= 221)
{
Info.SupportUprojectState = FInstallInfo::ESupportUproject::Release;
}
}
return Info;
}