From 16440bcf4319a7b041bbd07c32226759a6fb67cf Mon Sep 17 00:00:00 2001 From: Rikitav Date: Tue, 19 Aug 2025 04:33:02 +0400 Subject: [PATCH] * Added protection from NotImplementedException to HandlerBuilderBase * Moved AddHandler and AddHandler(Type) methods from IHandlersCollection to extension methods * Added public constructor to IHost types form extensibility * Code cleanup --- Telegrator.Hosting.Web/TelegramBotWebHost.cs | 25 ++++--- .../TelegramBotWebHostBuilder.cs | 43 ++++++++--- .../Components/IHostHandlersCollection.cs | 16 +++++ .../Providers/HostHandlersCollection.cs | 17 ++--- Telegrator.Hosting/TelegramBotHost.cs | 27 ++++--- Telegrator.Hosting/TelegramBotHostBuilder.cs | 39 +++++++--- .../Handlers/Components/UpdateHandlerBase.cs | 71 +++++++++++++------ .../MadiatorCore/IHandlersCollection.cs | 24 ------- Telegrator/Providers/HandlersCollection.cs | 51 ------------- Telegrator/TypesExtensions.cs | 41 ++++++++++- .../ApiMarkdownGenerator.cs | 4 +- ...plicitHandlerBuilderExtensionsGenerator.cs | 1 - .../RoslynExtensions/CollectionsExtensions.cs | 2 +- .../RoslynExtensions/DiagnosticsHelper.cs | 2 +- .../RoslynExtensions/Exceptions.cs | 2 +- .../MemberDeclarationSyntaxExtensions.cs | 1 - .../StringBuilderExtensions.cs | 2 +- .../RoslynExtensions/StringExtensions.cs | 2 +- .../RoslynExtensions/SymbolsExtensions.cs | 2 +- .../RoslynExtensions/SyntaxNodesExtensions.cs | 2 +- .../RoslynExtensions/SyntaxTokenExtensions.cs | 2 +- 21 files changed, 211 insertions(+), 165 deletions(-) create mode 100644 Telegrator.Hosting/Providers/Components/IHostHandlersCollection.cs diff --git a/Telegrator.Hosting.Web/TelegramBotWebHost.cs b/Telegrator.Hosting.Web/TelegramBotWebHost.cs index b70a229..56fb5a6 100644 --- a/Telegrator.Hosting.Web/TelegramBotWebHost.cs +++ b/Telegrator.Hosting.Web/TelegramBotWebHost.cs @@ -55,10 +55,15 @@ namespace Telegrator.Hosting.Web IFeatureCollection IApplicationBuilder.ServerFeatures => ((IApplicationBuilder)_innerApp).ServerFeatures; IDictionary IApplicationBuilder.Properties => ((IApplicationBuilder)_innerApp).Properties; - internal TelegramBotWebHost(WebApplicationBuilder webApplicationBuilder, HostHandlersCollection handlers) + /// + /// Initializes a new instance of the class. + /// + /// The proxied instance of host builder. + /// + public TelegramBotWebHost(WebApplicationBuilder webApplicationBuilder, IHandlersCollection handlers) { // Registering this host in services for easy access - RegisterHostServices(webApplicationBuilder, handlers); + RegisterHostServices(webApplicationBuilder.Services, handlers); // Building proxy application _innerApp = webApplicationBuilder.Build(); @@ -172,7 +177,7 @@ namespace Telegrator.Hosting.Web _disposed = true; } - private void LogHandlers(HostHandlersCollection handlers) + private void LogHandlers(IHandlersCollection handlers) { StringBuilder logBuilder = new StringBuilder("Registered handlers : "); if (!handlers.Keys.Any()) @@ -194,15 +199,15 @@ namespace Telegrator.Hosting.Web Logger.LogInformation(logBuilder.ToString()); } - private void RegisterHostServices(WebApplicationBuilder hostApplicationBuilder, HostHandlersCollection handlers) + private void RegisterHostServices(IServiceCollection service, IHandlersCollection handlers) { - //hostApplicationBuilder.Services.RemoveAll(); - //hostApplicationBuilder.Services.AddSingleton(this); + //service.RemoveAll(); + //service.AddSingleton(this); - hostApplicationBuilder.Services.AddSingleton(this); - hostApplicationBuilder.Services.AddSingleton(this); - hostApplicationBuilder.Services.AddSingleton(this); - hostApplicationBuilder.Services.AddSingleton(handlers); + service.AddSingleton(this); + service.AddSingleton(this); + service.AddSingleton(this); + service.AddSingleton(handlers); } } } diff --git a/Telegrator.Hosting.Web/TelegramBotWebHostBuilder.cs b/Telegrator.Hosting.Web/TelegramBotWebHostBuilder.cs index 058fe97..ff4a744 100644 --- a/Telegrator.Hosting.Web/TelegramBotWebHostBuilder.cs +++ b/Telegrator.Hosting.Web/TelegramBotWebHostBuilder.cs @@ -5,10 +5,10 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Telegram.Bot; -using Telegram.Bot.Polling; using Telegrator.Hosting.Components; using Telegrator.Hosting.Configuration; using Telegrator.Hosting.Providers; +using Telegrator.Hosting.Providers.Components; using Telegrator.MadiatorCore; #pragma warning disable IDE0001 @@ -21,7 +21,7 @@ namespace Telegrator.Hosting.Web { private readonly WebApplicationBuilder _innerBuilder; private readonly TelegramBotWebOptions _settings; - private readonly HostHandlersCollection _handlers; + private readonly IHandlersCollection _handlers; /// public IHandlersCollection Handlers => _handlers; @@ -38,28 +38,49 @@ namespace Telegrator.Hosting.Web /// public IHostEnvironment Environment => _innerBuilder.Environment; - internal TelegramBotWebHostBuilder(WebApplicationBuilder webApplicationBuilder, TelegramBotWebOptions settings) + /// + /// Initializes a new instance of the class. + /// + /// + /// + public TelegramBotWebHostBuilder(WebApplicationBuilder webApplicationBuilder, TelegramBotWebOptions settings) { - _innerBuilder = webApplicationBuilder; + _innerBuilder = webApplicationBuilder ?? throw new ArgumentNullException(nameof(webApplicationBuilder)); _settings = settings ?? throw new ArgumentNullException(nameof(settings)); _handlers = new HostHandlersCollection(Services, _settings); } + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + public TelegramBotWebHostBuilder(WebApplicationBuilder webApplicationBuilder, TelegramBotWebOptions settings, IHandlersCollection handlers) + { + _innerBuilder = webApplicationBuilder ?? throw new ArgumentNullException(nameof(webApplicationBuilder)); + _settings = settings ?? throw new ArgumentNullException(nameof(settings)); + _handlers = handlers ?? throw new ArgumentNullException(nameof(settings)); + } + /// /// Builds the host. /// /// public TelegramBotWebHost Build() { - foreach (PreBuildingRoutine preBuildRoutine in _handlers.PreBuilderRoutines) + if (_handlers is IHostHandlersCollection hostHandlers) { - try + foreach (PreBuildingRoutine preBuildRoutine in hostHandlers.PreBuilderRoutines) { - preBuildRoutine.Invoke(this); - } - catch (NotImplementedException) - { - _ = 0xBAD + 0xC0DE; + try + { + preBuildRoutine.Invoke(this); + } + catch (NotImplementedException) + { + _ = 0xBAD + 0xC0DE; + } } } diff --git a/Telegrator.Hosting/Providers/Components/IHostHandlersCollection.cs b/Telegrator.Hosting/Providers/Components/IHostHandlersCollection.cs new file mode 100644 index 0000000..d57002e --- /dev/null +++ b/Telegrator.Hosting/Providers/Components/IHostHandlersCollection.cs @@ -0,0 +1,16 @@ +using Telegrator.MadiatorCore; + +namespace Telegrator.Hosting.Providers.Components +{ + /// + /// Collection class for managing handler descriptors organized by update type for host apps. + /// Provides functionality for collecting, adding, scanning, and organizing handlers. + /// + public interface IHostHandlersCollection : IHandlersCollection + { + /// + /// List of tasks that should be completed right before building the bot + /// + public List PreBuilderRoutines { get; } + } +} diff --git a/Telegrator.Hosting/Providers/HostHandlersCollection.cs b/Telegrator.Hosting/Providers/HostHandlersCollection.cs index 39cd5ec..cc76683 100644 --- a/Telegrator.Hosting/Providers/HostHandlersCollection.cs +++ b/Telegrator.Hosting/Providers/HostHandlersCollection.cs @@ -2,6 +2,7 @@ using System.Reflection; using Telegrator.Configuration; using Telegrator.Hosting.Components; +using Telegrator.Hosting.Providers.Components; using Telegrator.MadiatorCore; using Telegrator.MadiatorCore.Descriptors; using Telegrator.Providers; @@ -15,7 +16,7 @@ namespace Telegrator.Hosting.Providers public delegate void PreBuildingRoutine(ITelegramBotHostBuilder builder); /// - public class HostHandlersCollection(IServiceCollection hostServiceColletion, ITelegratorOptions options) : HandlersCollection(options) + public class HostHandlersCollection(IServiceCollection hostServiceColletion, ITelegratorOptions options) : HandlersCollection(options), IHostHandlersCollection { private readonly IServiceCollection Services = hostServiceColletion; @@ -25,20 +26,14 @@ namespace Telegrator.Hosting.Providers /// /// List of tasks that should be completed right before building the bot /// - public readonly List PreBuilderRoutines = []; - - /// - public override IHandlersCollection AddHandler(Type handlerType) - { - if (handlerType.IsPreBuildingRoutine(out MethodInfo? routineMethod)) - PreBuilderRoutines.Add(routineMethod.CreateDelegate(null)); - - return base.AddHandler(handlerType); - } + public List PreBuilderRoutines { get; } = []; /// public override IHandlersCollection AddDescriptor(HandlerDescriptor descriptor) { + if (descriptor.HandlerType.IsPreBuildingRoutine(out MethodInfo? routineMethod)) + PreBuilderRoutines.Add(routineMethod.CreateDelegate(null)); + switch (descriptor.Type) { case DescriptorType.General: diff --git a/Telegrator.Hosting/TelegramBotHost.cs b/Telegrator.Hosting/TelegramBotHost.cs index cf84b1e..48349a2 100644 --- a/Telegrator.Hosting/TelegramBotHost.cs +++ b/Telegrator.Hosting/TelegramBotHost.cs @@ -5,9 +5,6 @@ using System.Text; using Telegram.Bot.Types.Enums; using Telegrator.Configuration; using Telegrator.Hosting.Components; -using Telegrator.Hosting.Logging; -using Telegrator.Logging; -using Telegrator.Hosting.Providers; using Telegrator.MadiatorCore; using Telegrator.MadiatorCore.Descriptors; @@ -19,13 +16,14 @@ namespace Telegrator.Hosting public class TelegramBotHost : ITelegramBotHost { private readonly IHost _innerHost; + private readonly IServiceProvider _serviceProvider; private readonly IUpdateRouter _updateRouter; private readonly ILogger _logger; private bool _disposed; /// - public IServiceProvider Services => _innerHost.Services; + public IServiceProvider Services => _serviceProvider; /// public IUpdateRouter UpdateRouter => _updateRouter; @@ -38,15 +36,16 @@ namespace Telegrator.Hosting /// /// Initializes a new instance of the class. /// - /// The service provider. + /// The proxied instance of host builder. /// - internal TelegramBotHost(HostApplicationBuilder hostApplicationBuilder, HostHandlersCollection handlers) + public TelegramBotHost(HostApplicationBuilder hostApplicationBuilder, IHandlersCollection handlers) { // Registering this host in services for easy access - RegisterHostServices(hostApplicationBuilder, handlers); + RegisterHostServices(hostApplicationBuilder.Services, handlers); // Building proxy hoster _innerHost = hostApplicationBuilder.Build(); + _serviceProvider = _innerHost.Services; // Initializing bot info, as it requires to make a request via tg bot Services.GetRequiredService(); @@ -131,7 +130,7 @@ namespace Telegrator.Hosting _disposed = true; } - private void LogHandlers(HostHandlersCollection handlers) + private void LogHandlers(IHandlersCollection handlers) { StringBuilder logBuilder = new StringBuilder("Registered handlers : "); if (!handlers.Keys.Any()) @@ -153,14 +152,14 @@ namespace Telegrator.Hosting Logger.LogInformation(logBuilder.ToString()); } - private void RegisterHostServices(HostApplicationBuilder hostApplicationBuilder, HostHandlersCollection handlers) + private void RegisterHostServices(IServiceCollection services, IHandlersCollection handlers) { - //hostApplicationBuilder.Services.RemoveAll(); - //hostApplicationBuilder.Services.AddSingleton(this); + //services.RemoveAll(); + //services.AddSingleton(this); - hostApplicationBuilder.Services.AddSingleton(this); - hostApplicationBuilder.Services.AddSingleton(this); - hostApplicationBuilder.Services.AddSingleton(handlers); + services.AddSingleton(this); + services.AddSingleton(this); + services.AddSingleton(handlers); } } } diff --git a/Telegrator.Hosting/TelegramBotHostBuilder.cs b/Telegrator.Hosting/TelegramBotHostBuilder.cs index 955fb50..9387e7d 100644 --- a/Telegrator.Hosting/TelegramBotHostBuilder.cs +++ b/Telegrator.Hosting/TelegramBotHostBuilder.cs @@ -9,6 +9,7 @@ using Telegrator.Hosting; using Telegrator.Hosting.Components; using Telegrator.Hosting.Configuration; using Telegrator.Hosting.Providers; +using Telegrator.Hosting.Providers.Components; using Telegrator.MadiatorCore; #pragma warning disable IDE0001 @@ -21,7 +22,7 @@ namespace Telegrator.Hosting { private readonly HostApplicationBuilder _innerBuilder; private readonly TelegramBotHostBuilderSettings _settings; - private readonly HostHandlersCollection _handlers; + private readonly IHandlersCollection _handlers; /// public IHandlersCollection Handlers => _handlers; @@ -43,30 +44,48 @@ namespace Telegrator.Hosting /// /// /// - internal TelegramBotHostBuilder(HostApplicationBuilder hostApplicationBuilder, TelegramBotHostBuilderSettings? settings = null) + public TelegramBotHostBuilder(HostApplicationBuilder hostApplicationBuilder, TelegramBotHostBuilderSettings? settings = null) { - _innerBuilder = hostApplicationBuilder; + _innerBuilder = hostApplicationBuilder ?? throw new ArgumentNullException(nameof(hostApplicationBuilder)); _settings = settings ?? new TelegramBotHostBuilderSettings(); _handlers = new HostHandlersCollection(Services, _settings); _innerBuilder.Logging.ClearProviders(); } + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + public TelegramBotHostBuilder(HostApplicationBuilder hostApplicationBuilder, IHandlersCollection handlers, TelegramBotHostBuilderSettings? settings = null) + { + _innerBuilder = hostApplicationBuilder ?? throw new ArgumentNullException(nameof(hostApplicationBuilder)); + _settings = settings ?? new TelegramBotHostBuilderSettings(); + _handlers = handlers ?? throw new ArgumentNullException(nameof(handlers)); + + _innerBuilder.Logging.ClearProviders(); + } + /// /// Builds the host. /// /// public TelegramBotHost Build() { - foreach (PreBuildingRoutine preBuildRoutine in _handlers.PreBuilderRoutines) + if (_handlers is IHostHandlersCollection hostHandlers) { - try + foreach (PreBuildingRoutine preBuildRoutine in hostHandlers.PreBuilderRoutines) { - preBuildRoutine.Invoke(this); - } - catch (NotImplementedException) - { - _ = 0xBAD + 0xC0DE; + try + { + preBuildRoutine.Invoke(this); + } + catch (NotImplementedException) + { + _ = 0xBAD + 0xC0DE; + } } } diff --git a/Telegrator/Handlers/Components/UpdateHandlerBase.cs b/Telegrator/Handlers/Components/UpdateHandlerBase.cs index fd48988..e3970de 100644 --- a/Telegrator/Handlers/Components/UpdateHandlerBase.cs +++ b/Telegrator/Handlers/Components/UpdateHandlerBase.cs @@ -1,4 +1,5 @@ -using Telegram.Bot; +using System.ComponentModel; +using Telegram.Bot; using Telegram.Bot.Polling; using Telegram.Bot.Types; using Telegram.Bot.Types.Enums; @@ -42,28 +43,49 @@ namespace Telegrator.Handlers.Components // Executing pre processor if (aspects != null) { - Result? preResult = await aspects - .ExecutePre(this, container, cancellationToken) - .ConfigureAwait(false); + try + { + Result? preResult = await aspects + .ExecutePre(this, container, cancellationToken) + .ConfigureAwait(false); - if (!preResult.Positive) - return preResult; + if (!preResult.Positive) + return preResult; + } + catch (NotImplementedException) + { + _ = 0xBAD + 0xC0DE; + } } - // Executing handler - Result execResult = await ExecuteInternal(container, cancellationToken).ConfigureAwait(false); - if (!execResult.Positive) - return execResult; - - // Executing post processor - if (aspects != null) + try { - Result postResult = await aspects - .ExecutePost(this, container, cancellationToken) - .ConfigureAwait(false); + // Executing handler + Result execResult = await ExecuteInternal(container, cancellationToken).ConfigureAwait(false); + if (!execResult.Positive) + return execResult; + } + catch (NotImplementedException) + { + _ = 0xBAD + 0xC0DE; + } - if (!postResult.Positive) - return postResult; + try + { + // Executing post processor + if (aspects != null) + { + Result postResult = await aspects + .ExecutePost(this, container, cancellationToken) + .ConfigureAwait(false); + + if (!postResult.Positive) + return postResult; + } + } + catch (NotImplementedException) + { + _ = 0xBAD + 0xC0DE; } // Success @@ -77,9 +99,16 @@ namespace Telegrator.Handlers.Components } catch (Exception exception) { - await described.UpdateRouter - .HandleErrorAsync(described.Client, exception, HandleErrorSource.HandleUpdateError, cancellationToken) - .ConfigureAwait(false); + try + { + await described.UpdateRouter + .HandleErrorAsync(described.Client, exception, HandleErrorSource.HandleUpdateError, cancellationToken) + .ConfigureAwait(false); + } + catch (NotImplementedException) + { + _ = 0xBAD + 0xC0DE; + } return Result.Fault(); } diff --git a/Telegrator/MadiatorCore/IHandlersCollection.cs b/Telegrator/MadiatorCore/IHandlersCollection.cs index 9bfe793..09f44ab 100644 --- a/Telegrator/MadiatorCore/IHandlersCollection.cs +++ b/Telegrator/MadiatorCore/IHandlersCollection.cs @@ -1,5 +1,4 @@ using Telegram.Bot.Types.Enums; -using Telegrator.Handlers.Components; using Telegrator.MadiatorCore.Descriptors; namespace Telegrator.MadiatorCore @@ -32,14 +31,6 @@ namespace Telegrator.MadiatorCore /// The handler descriptor list for the given update type. public HandlerDescriptorList this[UpdateType updateType] { get; } - /* - /// - /// Collects all handlers domain-wide and returns a new . - /// - /// A new with all handlers collected. - public IHandlersCollection CollectHandlersDomainWide(); - */ - /// /// Adds a to the collection and returns the updated collection. /// @@ -47,21 +38,6 @@ namespace Telegrator.MadiatorCore /// The updated . public IHandlersCollection AddDescriptor(HandlerDescriptor descriptor); - /// - /// Adds a handler of the specified type to the collection and returns the updated collection. - /// - /// The type of handler to add, must inherit from . - /// The updated . - public IHandlersCollection AddHandler() where THandler : UpdateHandlerBase; - - /// - /// Adds a handler of the specified type to the collection and returns the updated collection. - /// - /// The type of handler to add. - /// The updated . - /// Thrown if the handler type is invalid. - public IHandlersCollection AddHandler(Type handlerType); - /// /// Gets the for the specified . /// diff --git a/Telegrator/Providers/HandlersCollection.cs b/Telegrator/Providers/HandlersCollection.cs index 0394c1c..6a8c741 100644 --- a/Telegrator/Providers/HandlersCollection.cs +++ b/Telegrator/Providers/HandlersCollection.cs @@ -88,42 +88,6 @@ namespace Telegrator.Providers return this; } - /// - /// Adds a handler type to the collection. - /// - /// The type of handler to add. - /// This collection instance for method chaining. - public virtual IHandlersCollection AddHandler() where THandler : UpdateHandlerBase - { - AddHandler(typeof(THandler)); - return this; - } - - /// - /// Adds a handler type to the collection. - /// - /// The type of handler to add. - /// This collection instance for method chaining. - /// Thrown when the type is not a valid handler implementation. - public virtual IHandlersCollection AddHandler(Type handlerType) - { - if (!handlerType.IsHandlerRealization()) - throw new Exception(); - - if (handlerType.IsCustomDescriptorsProvider()) - { - foreach (HandlerDescriptor handlerDescriptor in InvokeCustomDescriptorsProvider(handlerType)) - AddDescriptor(handlerDescriptor); - } - else - { - HandlerDescriptor descriptor = new HandlerDescriptor(DescriptorType.General, handlerType); - AddDescriptor(descriptor); - } - - return this; - } - /// /// Gets or creates a descriptor list for the specified update type. /// @@ -163,20 +127,5 @@ namespace Telegrator.Providers CommandAliasses.AddRange(alliasAttribute.Alliases); } - - /// - /// Invokes a custom descriptors provider to get handler descriptors. - /// - /// The handler type that implements ICustomDescriptorsProvider. - /// A collection of handler descriptors from the custom provider. - /// Thrown when the handler type doesn't have a parameterless constructor or cannot be instantiated. - protected virtual IEnumerable InvokeCustomDescriptorsProvider(Type handlerType) - { - if (!handlerType.HasParameterlessCtor()) - throw new Exception(); - - ICustomDescriptorsProvider? provider = (ICustomDescriptorsProvider?)Activator.CreateInstance(handlerType); - return provider == null ? throw new Exception() : provider.DescribeHandlers(); - } } } diff --git a/Telegrator/TypesExtensions.cs b/Telegrator/TypesExtensions.cs index 8e8c2a3..f0681b1 100644 --- a/Telegrator/TypesExtensions.cs +++ b/Telegrator/TypesExtensions.cs @@ -86,7 +86,7 @@ namespace Telegrator throw new InvalidDataException("Message does not contain a command"); if (message is not { Text.Length: > 0 }) - throw new ArgumentNullException("Command text cannot be null or empty"); + throw new ArgumentNullException(nameof(message), "Command text cannot be null or empty"); if (!message.Text.Contains(' ')) throw new MissingMemberException("Command dont contains arguments"); @@ -620,6 +620,45 @@ namespace Telegrator public static HandlerBuilder CreateCallbackQuery(this IHandlersCollection handlers) => handlers.CreateHandler(UpdateType.CallbackQuery); + /// + /// Adds a handler type to the collection. + /// + /// The handlers collection. + /// The type of handler to add. + /// This collection instance for method chaining. + public static IHandlersCollection AddHandler(this IHandlersCollection handlers) where THandler : UpdateHandlerBase + => handlers.AddHandler(typeof(THandler)); + + /// + /// Adds a handler type to the collection. + /// + /// The handlers collection. + /// The type of handler to add. + /// This collection instance for method chaining. + /// Thrown when the type is not a valid handler implementation. + public static IHandlersCollection AddHandler(this IHandlersCollection handlers, Type handlerType) + { + if (!handlerType.IsHandlerRealization()) + throw new Exception(); + + if (handlerType.IsCustomDescriptorsProvider()) + { + if (!handlerType.HasParameterlessCtor()) + throw new Exception(); + + ICustomDescriptorsProvider provider = (ICustomDescriptorsProvider)Activator.CreateInstance(handlerType); + foreach (HandlerDescriptor handlerDescriptor in provider.DescribeHandlers()) + handlers.AddDescriptor(handlerDescriptor); + } + else + { + HandlerDescriptor descriptor = new HandlerDescriptor(DescriptorType.General, handlerType); + handlers.AddDescriptor(descriptor); + } + + return handlers; + } + /// /// Creates implicit handler from method /// diff --git a/dev/Telegrator.RoslynGenerators/ApiMarkdownGenerator.cs b/dev/Telegrator.RoslynGenerators/ApiMarkdownGenerator.cs index bf36eb5..d2abfc8 100644 --- a/dev/Telegrator.RoslynGenerators/ApiMarkdownGenerator.cs +++ b/dev/Telegrator.RoslynGenerators/ApiMarkdownGenerator.cs @@ -1,11 +1,11 @@ +#if DEBUG using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using System.Collections.Immutable; using System.Text; using System.Xml.Linq; -using Telegrator.RoslynExtensions; +using Telegrator.RoslynGenerators.RoslynExtensions; -#if DEBUG namespace Telegrator.RoslynGenerators { /// diff --git a/dev/Telegrator.RoslynGenerators/ImplicitHandlerBuilderExtensionsGenerator.cs b/dev/Telegrator.RoslynGenerators/ImplicitHandlerBuilderExtensionsGenerator.cs index a910eb5..2b701b1 100644 --- a/dev/Telegrator.RoslynGenerators/ImplicitHandlerBuilderExtensionsGenerator.cs +++ b/dev/Telegrator.RoslynGenerators/ImplicitHandlerBuilderExtensionsGenerator.cs @@ -3,7 +3,6 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using System.Collections.Immutable; using System.Text; -using Telegrator.RoslynExtensions; using Telegrator.RoslynGenerators.RoslynExtensions; #if DEBUG diff --git a/dev/Telegrator.RoslynGenerators/RoslynExtensions/CollectionsExtensions.cs b/dev/Telegrator.RoslynGenerators/RoslynExtensions/CollectionsExtensions.cs index 35bf4fe..bac7255 100644 --- a/dev/Telegrator.RoslynGenerators/RoslynExtensions/CollectionsExtensions.cs +++ b/dev/Telegrator.RoslynGenerators/RoslynExtensions/CollectionsExtensions.cs @@ -1,4 +1,4 @@ -namespace Telegrator.RoslynExtensions +namespace Telegrator.RoslynGenerators.RoslynExtensions { public static class CollectionsExtensions { diff --git a/dev/Telegrator.RoslynGenerators/RoslynExtensions/DiagnosticsHelper.cs b/dev/Telegrator.RoslynGenerators/RoslynExtensions/DiagnosticsHelper.cs index 7f19ae5..43847b4 100644 --- a/dev/Telegrator.RoslynGenerators/RoslynExtensions/DiagnosticsHelper.cs +++ b/dev/Telegrator.RoslynGenerators/RoslynExtensions/DiagnosticsHelper.cs @@ -1,6 +1,6 @@ using Microsoft.CodeAnalysis; -namespace Telegrator.RoslynExtensions +namespace Telegrator.RoslynGenerators.RoslynExtensions { public static class DiagnosticsHelper { diff --git a/dev/Telegrator.RoslynGenerators/RoslynExtensions/Exceptions.cs b/dev/Telegrator.RoslynGenerators/RoslynExtensions/Exceptions.cs index 6cbc6d3..ac35f2d 100644 --- a/dev/Telegrator.RoslynGenerators/RoslynExtensions/Exceptions.cs +++ b/dev/Telegrator.RoslynGenerators/RoslynExtensions/Exceptions.cs @@ -1,4 +1,4 @@ -namespace Telegrator.RoslynExtensions; +namespace Telegrator.RoslynGenerators.RoslynExtensions; public class TargteterNotFoundException() : Exception() { } diff --git a/dev/Telegrator.RoslynGenerators/RoslynExtensions/MemberDeclarationSyntaxExtensions.cs b/dev/Telegrator.RoslynGenerators/RoslynExtensions/MemberDeclarationSyntaxExtensions.cs index 6e39050..557b9c9 100644 --- a/dev/Telegrator.RoslynGenerators/RoslynExtensions/MemberDeclarationSyntaxExtensions.cs +++ b/dev/Telegrator.RoslynGenerators/RoslynExtensions/MemberDeclarationSyntaxExtensions.cs @@ -1,7 +1,6 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Telegrator.RoslynExtensions; namespace Telegrator.RoslynGenerators.RoslynExtensions { diff --git a/dev/Telegrator.RoslynGenerators/RoslynExtensions/StringBuilderExtensions.cs b/dev/Telegrator.RoslynGenerators/RoslynExtensions/StringBuilderExtensions.cs index be5f2a9..4f3e45e 100644 --- a/dev/Telegrator.RoslynGenerators/RoslynExtensions/StringBuilderExtensions.cs +++ b/dev/Telegrator.RoslynGenerators/RoslynExtensions/StringBuilderExtensions.cs @@ -1,6 +1,6 @@ using System.Text; -namespace Telegrator.RoslynExtensions +namespace Telegrator.RoslynGenerators.RoslynExtensions { public static class StringBuilderExtensions { diff --git a/dev/Telegrator.RoslynGenerators/RoslynExtensions/StringExtensions.cs b/dev/Telegrator.RoslynGenerators/RoslynExtensions/StringExtensions.cs index 7967f54..ddfeadc 100644 --- a/dev/Telegrator.RoslynGenerators/RoslynExtensions/StringExtensions.cs +++ b/dev/Telegrator.RoslynGenerators/RoslynExtensions/StringExtensions.cs @@ -1,4 +1,4 @@ -namespace Telegrator.RoslynExtensions +namespace Telegrator.RoslynGenerators.RoslynExtensions { public static class StringExtensions { diff --git a/dev/Telegrator.RoslynGenerators/RoslynExtensions/SymbolsExtensions.cs b/dev/Telegrator.RoslynGenerators/RoslynExtensions/SymbolsExtensions.cs index 090169b..b37791b 100644 --- a/dev/Telegrator.RoslynGenerators/RoslynExtensions/SymbolsExtensions.cs +++ b/dev/Telegrator.RoslynGenerators/RoslynExtensions/SymbolsExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.CodeAnalysis; -namespace Telegrator.RoslynExtensions; +namespace Telegrator.RoslynGenerators.RoslynExtensions; public static class SymbolsExtensions { diff --git a/dev/Telegrator.RoslynGenerators/RoslynExtensions/SyntaxNodesExtensions.cs b/dev/Telegrator.RoslynGenerators/RoslynExtensions/SyntaxNodesExtensions.cs index 00be76e..0b3ac0f 100644 --- a/dev/Telegrator.RoslynGenerators/RoslynExtensions/SyntaxNodesExtensions.cs +++ b/dev/Telegrator.RoslynGenerators/RoslynExtensions/SyntaxNodesExtensions.cs @@ -2,7 +2,7 @@ using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace Telegrator.RoslynExtensions +namespace Telegrator.RoslynGenerators.RoslynExtensions { public static class SyntaxNodesExtensions { diff --git a/dev/Telegrator.RoslynGenerators/RoslynExtensions/SyntaxTokenExtensions.cs b/dev/Telegrator.RoslynGenerators/RoslynExtensions/SyntaxTokenExtensions.cs index e59a245..de37648 100644 --- a/dev/Telegrator.RoslynGenerators/RoslynExtensions/SyntaxTokenExtensions.cs +++ b/dev/Telegrator.RoslynGenerators/RoslynExtensions/SyntaxTokenExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.CodeAnalysis; -namespace Telegrator.RoslynExtensions +namespace Telegrator.RoslynGenerators.RoslynExtensions { public static class SyntaxTokenExtensions {