From 5cca0b1bfcc519f190e88a1f3eed11b18ebedd7c Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Sat, 1 Nov 2025 13:21:51 +1000 Subject: [PATCH] nuget client v1 --- Directory.Packages.props | 2 +- .../Features/Nuget/NugetClientService.cs | 17 +++++++++++++++++ src/SharpIDE.Godot/DiAutoload.cs | 2 ++ .../Features/BottomPanel/BottomPanelManager.cs | 1 + src/SharpIDE.Godot/Features/Nuget/NugetPanel.cs | 12 ++++++++++++ 5 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/SharpIDE.Application/Features/Nuget/NugetClientService.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 4c5ae62..596512f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -43,7 +43,7 @@ - + diff --git a/src/SharpIDE.Application/Features/Nuget/NugetClientService.cs b/src/SharpIDE.Application/Features/Nuget/NugetClientService.cs new file mode 100644 index 0000000..4359809 --- /dev/null +++ b/src/SharpIDE.Application/Features/Nuget/NugetClientService.cs @@ -0,0 +1,17 @@ +using NuGet.Configuration; +using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence; + +namespace SharpIDE.Application.Features.Nuget; + +public class NugetClientService +{ + public async Task Test(string directoryPath) + { + var settings = Settings.LoadDefaultSettings(root: directoryPath); + var packageSourceProvider = new PackageSourceProvider(settings); + var packageSources = packageSourceProvider.LoadPackageSources().Where(p => p.IsEnabled).ToList(); + + // Get top 100 packages across all sources, ordered by download count + + } +} diff --git a/src/SharpIDE.Godot/DiAutoload.cs b/src/SharpIDE.Godot/DiAutoload.cs index 31d005c..dd97a48 100644 --- a/src/SharpIDE.Godot/DiAutoload.cs +++ b/src/SharpIDE.Godot/DiAutoload.cs @@ -9,6 +9,7 @@ using SharpIDE.Application.Features.Evaluation; using SharpIDE.Application.Features.FilePersistence; using SharpIDE.Application.Features.FileWatching; using SharpIDE.Application.Features.NavigationHistory; +using SharpIDE.Application.Features.Nuget; using SharpIDE.Application.Features.Run; using SharpIDE.Application.Features.Search; @@ -36,6 +37,7 @@ public partial class DiAutoload : Node services.AddScoped(); services.AddScoped(); services.AddScoped(); + services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); diff --git a/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs b/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs index aa0f7fd..ad8334b 100644 --- a/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs +++ b/src/SharpIDE.Godot/Features/BottomPanel/BottomPanelManager.cs @@ -18,6 +18,7 @@ public partial class BottomPanelManager : Panel { field = value; _problemsPanel.Solution = value; + _nugetPanel.Solution = value; } } diff --git a/src/SharpIDE.Godot/Features/Nuget/NugetPanel.cs b/src/SharpIDE.Godot/Features/Nuget/NugetPanel.cs index 8a1df87..41facd1 100644 --- a/src/SharpIDE.Godot/Features/Nuget/NugetPanel.cs +++ b/src/SharpIDE.Godot/Features/Nuget/NugetPanel.cs @@ -1,4 +1,6 @@ using Godot; +using SharpIDE.Application.Features.Nuget; +using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence; namespace SharpIDE.Godot.Features.Nuget; @@ -7,11 +9,21 @@ public partial class NugetPanel : Control private VBoxContainer _installedPackagesVboxContainer = null!; private VBoxContainer _implicitlyInstalledPackagesItemList = null!; private VBoxContainer _availablePackagesItemList = null!; + + public SharpIdeSolutionModel? Solution { get; set; } + + [Inject] private readonly NugetClientService _nugetClientService = null!; public override void _Ready() { _installedPackagesVboxContainer = GetNode("%InstalledPackagesVBoxContainer"); _implicitlyInstalledPackagesItemList = GetNode("%ImplicitlyInstalledPackagesVBoxContainer"); _availablePackagesItemList = GetNode("%AvailablePackagesVBoxContainer"); + + _ = Task.GodotRun(async () => + { + await Task.Delay(300); + await _nugetClientService.Test(Solution!.DirectoryPath); + }); } } \ No newline at end of file