diff --git a/src/SharpIDE.Application/DependencyInjection.cs b/src/SharpIDE.Application/DependencyInjection.cs new file mode 100644 index 0000000..7a73044 --- /dev/null +++ b/src/SharpIDE.Application/DependencyInjection.cs @@ -0,0 +1,39 @@ +using Microsoft.Extensions.DependencyInjection; +using SharpIDE.Application.Features.Analysis; +using SharpIDE.Application.Features.Build; +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; +using SharpIDE.Application.Features.Testing; + +namespace SharpIDE.Application; + +public static class DependencyInjection +{ + public static IServiceCollection AddApplication(this IServiceCollection services) + { + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + return services; + } +} diff --git a/src/SharpIDE.Godot/DiAutoload.cs b/src/SharpIDE.Godot/DiAutoload.cs index c0ff9dd..3924259 100644 --- a/src/SharpIDE.Godot/DiAutoload.cs +++ b/src/SharpIDE.Godot/DiAutoload.cs @@ -3,16 +3,7 @@ using System.Reflection; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; -using SharpIDE.Application.Features.Analysis; -using SharpIDE.Application.Features.Build; -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; -using SharpIDE.Application.Features.Testing; +using SharpIDE.Application; using SharpIDE.Godot.Features.ActivityListener; namespace SharpIDE.Godot; @@ -29,25 +20,8 @@ public partial class DiAutoload : Node { GD.Print("[Injector] _EnterTree called"); var services = new ServiceCollection(); - // Register services here - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); + + services.AddApplication(); services.AddScoped(); services.AddScoped();