From 49362132496bd709c37df7ca0fd601d73ad34c95 Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Fri, 21 Jul 2023 17:00:35 +0100 Subject: [PATCH] Fix plugin module being case sensitive comparing guids --- src/Artemis.Core/Services/WebServer/PluginsModule.cs | 5 +++-- .../Screens/Debugger/Tabs/Logs/LogsDebugViewModel.cs | 9 +-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/Artemis.Core/Services/WebServer/PluginsModule.cs b/src/Artemis.Core/Services/WebServer/PluginsModule.cs index e4d234326..c9d423760 100644 --- a/src/Artemis.Core/Services/WebServer/PluginsModule.cs +++ b/src/Artemis.Core/Services/WebServer/PluginsModule.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using EmbedIO; @@ -15,7 +16,7 @@ public class PluginsModule : WebModuleBase internal PluginsModule(string baseRoute) : base(baseRoute) { - _pluginEndPoints = new Dictionary>(); + _pluginEndPoints = new Dictionary>(comparer: StringComparer.InvariantCultureIgnoreCase); } internal void AddPluginEndPoint(PluginEndPoint registration) diff --git a/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugViewModel.cs b/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugViewModel.cs index 47309a3ad..95a87a167 100644 --- a/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugViewModel.cs +++ b/src/Artemis.UI/Screens/Debugger/Tabs/Logs/LogsDebugViewModel.cs @@ -56,14 +56,7 @@ public class LogsDebugViewModel : ActivatableViewModelBase _formatter.Format(logEvent, writer); string line = writer.ToString(); - StringBuilder builder = new(); - - //hack: https://github.com/AvaloniaUI/Avalonia/issues/10913 - string paddedLine2 = line.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries) - .Aggregate(builder, (sb, s) => sb.Append(s).Append(' ', 400 - s.Length).AppendLine()) - .ToString(); - - Lines.Add(new Run(paddedLine2) + Lines.Add(new Run(line.TrimEnd('\r', '\n') + '\n') { Foreground = logEvent.Level switch {