This commit is contained in:
Matt Parker
2025-11-03 01:02:59 +10:00
parent b46404c387
commit 7b4b4b982e

View File

@@ -36,7 +36,21 @@ public partial class NugetPanel : Control
_implicitlyInstalledPackagesItemList.QueueFreeChildren(); _implicitlyInstalledPackagesItemList.QueueFreeChildren();
_availablePackagesItemList.QueueFreeChildren(); _availablePackagesItemList.QueueFreeChildren();
_solutionOrProjectOptionButton.ItemSelected += OnSolutionOrProjectSelected; _ = Task.GodotRun(_AsyncReady);
}
private async Task _AsyncReady()
{
await _sharpIdeSolutionAccessor.SolutionReadyTcs.Task;
_solution = _sharpIdeSolutionAccessor.SolutionModel;
await this.InvokeAsync(() =>
{
foreach (var project in _solution!.AllProjects)
{
_solutionOrProjectOptionButton.AddIconItem(_csprojIcon, project.Name);
}
_solutionOrProjectOptionButton.ItemSelected += OnSolutionOrProjectSelected;
});
OnSolutionOrProjectSelected(0); OnSolutionOrProjectSelected(0);
} }
@@ -44,18 +58,8 @@ public partial class NugetPanel : Control
{ {
_ = Task.GodotRun(async () => _ = Task.GodotRun(async () =>
{ {
if (_solution is null) if (_solution is null) throw new InvalidOperationException("Solution is null but should not be");
{
await _sharpIdeSolutionAccessor.SolutionReadyTcs.Task;
_solution = _sharpIdeSolutionAccessor.SolutionModel;
}
await this.InvokeAsync(() =>
{
foreach (var project in _solution!.AllProjects)
{
_solutionOrProjectOptionButton.AddIconItem(_csprojIcon, project.Name);
}
});
var result = await _nugetClientService.GetTop100Results(_solution!.DirectoryPath); var result = await _nugetClientService.GetTop100Results(_solution!.DirectoryPath);
_ = Task.GodotRun(async () => _ = Task.GodotRun(async () =>