void FRiderSourceCodeAccessor::CachePathToSln()

in Source/RiderSourceCodeAccess/Private/RiderSourceCodeAccessor.cpp [319:353]


void FRiderSourceCodeAccessor::CachePathToSln() const
{
	if (CachedSolutionPathOverride.Len() > 0)
	{
		CachedSolutionPath = CachedSolutionPathOverride + TEXT(".sln");
	}
	else
	{
		CachedSolutionPath = FPaths::ConvertRelativePathToFull(FPaths::ProjectDir());

		if (!FUProjectDictionary(FPaths::RootDir()).IsForeignProject(CachedSolutionPath))
		{
			FString PrimaryProjectName;
			if (!FFileHelper::LoadFileToString(PrimaryProjectName, *(FPaths::EngineIntermediateDir() / TEXT("ProjectFiles/PrimaryProjectName.txt"))))
			{
				PrimaryProjectName = "UE5";
			}
			CachedSolutionPath = FPaths::Combine(FPaths::RootDir(), PrimaryProjectName + TEXT(".sln"));
		}
		else
		{
			const FProjectDescriptor* CurrentProject = IProjectManager::Get().GetCurrentProject();

			if (CurrentProject == nullptr || CurrentProject->Modules.Num() == 0)
			{
				CachedSolutionPath = TEXT("");
			}
			else
			{
				const FString BaseName = FApp::HasProjectName() ? FApp::GetProjectName() : FPaths::GetBaseFilename(CachedSolutionPath);
				CachedSolutionPath = FPaths::Combine(CachedSolutionPath, BaseName + TEXT(".sln"));
			}
		}
	}
}