Add reload project method to ProjectEvaluation

This commit is contained in:
Matt Parker
2025-10-13 23:18:08 +10:00
parent a61362b07e
commit f75031bf4f

View File

@@ -19,6 +19,17 @@ public static class ProjectEvaluation
return project;
}
public static async Task ReloadProject(string projectFilePath)
{
using var _ = SharpIdeOtel.Source.StartActivity($"{nameof(ProjectEvaluation)}.{nameof(ReloadProject)}");
Guard.Against.Null(projectFilePath, nameof(projectFilePath));
var project = _projectCollection.GetLoadedProjects(projectFilePath).Single();
var projectRootElement = project.Xml;
projectRootElement.Reload();
project.ReevaluateIfNecessary();
}
public static string? GetOutputDllFullPath(SharpIdeProjectModel projectModel)
{
var project = _projectCollection.GetLoadedProjects(projectModel.FilePath).Single();