From f74d75d9fdcf42c9811f45277a8489f0e079ecfa Mon Sep 17 00:00:00 2001 From: Tig Date: Tue, 3 Sep 2024 08:35:03 -0600 Subject: [PATCH 1/9] Fixed dim test that fails in retail --- UnitTests/View/Layout/Dim.Tests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitTests/View/Layout/Dim.Tests.cs b/UnitTests/View/Layout/Dim.Tests.cs index 2ea62f2442..004ee2c971 100644 --- a/UnitTests/View/Layout/Dim.Tests.cs +++ b/UnitTests/View/Layout/Dim.Tests.cs @@ -342,7 +342,7 @@ public void Only_DimAbsolute_And_DimFactor_As_A_Different_Procedure_For_Assignin #if DEBUG Assert.Equal ("Combine(Fill(Absolute(0))-Absolute(2))", v2.Height.ToString ()); #else - Assert.Equal ("Combine(Fill(0)-Absolute(2))", v2.Height.ToString ()); + Assert.Equal ("Combine(Fill(Absolute(0)-Absolute(2))", v2.Height.ToString ()); #endif Assert.Equal (47, v2.Frame.Width); // 49-2=47 Assert.Equal (89, v2.Frame.Height); // 98-5-2-2=89 From 5cdac86fea655b835e99719188742a42a198a6b9 Mon Sep 17 00:00:00 2001 From: Tig Date: Tue, 3 Sep 2024 08:42:37 -0600 Subject: [PATCH 2/9] Fixed warnings --- Terminal.Gui/Configuration/ConfigurationManager.cs | 1 + Terminal.Gui/View/Layout/Dim.cs | 2 +- Terminal.Gui/View/Layout/Pos.cs | 2 +- Terminal.Gui/View/View.Hierarchy.cs | 2 ++ Terminal.Gui/View/View.Layout.cs | 4 ++-- Terminal.Gui/Views/ColorPicker.cs | 4 ++-- Terminal.Gui/Views/Toplevel.cs | 2 +- UICatalog/UICatalog.cs | 8 ++++++-- UnitTests/FileServices/FileDialogTests.cs | 3 +-- 9 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Terminal.Gui/Configuration/ConfigurationManager.cs b/Terminal.Gui/Configuration/ConfigurationManager.cs index e234b6ee7f..25826339a2 100644 --- a/Terminal.Gui/Configuration/ConfigurationManager.cs +++ b/Terminal.Gui/Configuration/ConfigurationManager.cs @@ -110,6 +110,7 @@ public enum ConfigLocations TypeInfoResolver = SourceGenerationContext.Default }; + [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "")] internal static readonly SourceGenerationContext _serializerContext = new (_serializerOptions); [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "")] diff --git a/Terminal.Gui/View/Layout/Dim.cs b/Terminal.Gui/View/Layout/Dim.cs index 7a9b47ef83..83d169e2cf 100644 --- a/Terminal.Gui/View/Layout/Dim.cs +++ b/Terminal.Gui/View/Layout/Dim.cs @@ -49,7 +49,7 @@ namespace Terminal.Gui; /// /// /// -/// +/// /// /// /// Creates a object that fills the dimension from the View's X position diff --git a/Terminal.Gui/View/Layout/Pos.cs b/Terminal.Gui/View/Layout/Pos.cs index 56391b8795..b5233a6dcb 100644 --- a/Terminal.Gui/View/Layout/Pos.cs +++ b/Terminal.Gui/View/Layout/Pos.cs @@ -333,7 +333,7 @@ public static Pos Percent (int percent) /// /// Indicates whether the specified type is in the hierarchy of this Pos object. /// - /// A reference to this instance. + /// A reference to this instance. /// public bool Has (out Pos pos) where T : Pos { diff --git a/Terminal.Gui/View/View.Hierarchy.cs b/Terminal.Gui/View/View.Hierarchy.cs index 19cef890b3..4ef00a5b77 100644 --- a/Terminal.Gui/View/View.Hierarchy.cs +++ b/Terminal.Gui/View/View.Hierarchy.cs @@ -1,10 +1,12 @@ #nullable enable using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; namespace Terminal.Gui; public partial class View // SuperView/SubView hierarchy management (SuperView, SubViews, Add, Remove, etc.) { + [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "")] private static readonly IList _empty = new List (0).AsReadOnly (); private List? _subviews; // This is null, and allocated on demand. diff --git a/Terminal.Gui/View/View.Layout.cs b/Terminal.Gui/View/View.Layout.cs index b407d4fa18..99b339da32 100644 --- a/Terminal.Gui/View/View.Layout.cs +++ b/Terminal.Gui/View/View.Layout.cs @@ -451,7 +451,7 @@ public Pos Y /// . /// /// - /// If set to a relative value (e.g. ) the value is indeterminate until the view has + /// If set to a relative value (e.g. ) the value is indeterminate until the view has /// been initialized ( is true) and has been /// called. /// @@ -500,7 +500,7 @@ public Dim? Height /// . /// /// - /// If set to a relative value (e.g. ) the value is indeterminate until the view has + /// If set to a relative value (e.g. ) the value is indeterminate until the view has /// been initialized ( is true) and has been /// called. /// diff --git a/Terminal.Gui/Views/ColorPicker.cs b/Terminal.Gui/Views/ColorPicker.cs index 00d6ee3f5d..9c5cec83be 100644 --- a/Terminal.Gui/Views/ColorPicker.cs +++ b/Terminal.Gui/Views/ColorPicker.cs @@ -154,7 +154,7 @@ private void CreateNameField () _tfName.Autocomplete = auto; _tfName.HasFocusChanged += UpdateValueFromName; - _tfName.Accept += (_s, _) => UpdateValueFromName (); + _tfName.Accept += (s, _) => UpdateValueFromName (); } private void CreateTextField () @@ -303,7 +303,7 @@ private void UpdateSingleBarValueFromTextField (object? sender) } } - private void UpdateValueFromName (object sender, HasFocusEventArgs e) + private void UpdateValueFromName (object? sender, HasFocusEventArgs e) { // if the new value of Focused is true then it is an enter event so ignore if (e.NewValue) diff --git a/Terminal.Gui/Views/Toplevel.cs b/Terminal.Gui/Views/Toplevel.cs index d4dc3e1cfd..a97bef4739 100644 --- a/Terminal.Gui/Views/Toplevel.cs +++ b/Terminal.Gui/Views/Toplevel.cs @@ -24,7 +24,7 @@ public partial class Toplevel : View /// /// Initializes a new instance of the class, /// defaulting to full screen. The and properties will be set to the - /// dimensions of the terminal using . + /// dimensions of the terminal using . /// public Toplevel () { diff --git a/UICatalog/UICatalog.cs b/UICatalog/UICatalog.cs index 471e0984ad..3eed462edf 100644 --- a/UICatalog/UICatalog.cs +++ b/UICatalog/UICatalog.cs @@ -5,6 +5,7 @@ using System.Collections.ObjectModel; using System.CommandLine; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; @@ -55,9 +56,11 @@ public class UICatalogApp private static int _cachedScenarioIndex; private static string? _cachedTheme = string.Empty; private static ObservableCollection? _categories; + [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "")] private static readonly FileSystemWatcher _currentDirWatcher = new (); private static ViewDiagnosticFlags _diagnosticFlags; private static string _forceDriver = string.Empty; + [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "")] private static readonly FileSystemWatcher _homeDirWatcher = new (); private static bool _isFirstRunning = true; private static Options _options; @@ -406,7 +409,7 @@ public UICatalogTopLevel () _diagnosticFlags = Diagnostics; _themeMenuItems = CreateThemeMenuItems (); - _themeMenuBarItem = new ("_Themes", _themeMenuItems); + _themeMenuBarItem = new ("_Themes", _themeMenuItems!); MenuBar menuBar = new () { @@ -676,7 +679,7 @@ public void ConfigChanged () ColorScheme = Colors.ColorSchemes [_topLevelColorScheme]; - MenuBar!.Menus [0].Children [0].ShortcutKey = Application.QuitKey; + MenuBar!.Menus [0].Children! [0]!.ShortcutKey = Application.QuitKey; if (StatusBar is { }) { @@ -783,6 +786,7 @@ private void CategoryView_SelectedChanged (object? sender, ListViewItemEventArgs private void ConfigAppliedHandler (object? sender, ConfigurationManagerEventArgs? a) { ConfigChanged (); } + [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "")] private MenuItem [] CreateDiagnosticFlagsMenuItems () { const string OFF = "View Diagnostics: _Off"; diff --git a/UnitTests/FileServices/FileDialogTests.cs b/UnitTests/FileServices/FileDialogTests.cs index afa6c1b63b..8ee2a8202d 100644 --- a/UnitTests/FileServices/FileDialogTests.cs +++ b/UnitTests/FileServices/FileDialogTests.cs @@ -4,7 +4,7 @@ namespace Terminal.Gui.FileServicesTests; -public class FileDialogTests (ITestOutputHelper output) +public class FileDialogTests () { [Theory] [InlineData (true)] @@ -787,7 +787,6 @@ private TextField GetTextField (FileDialog dlg, FileDialogPart part) return dlg.Subviews.OfType ().ElementAt (0); case FileDialogPart.SearchField: return dlg.Subviews.OfType ().ElementAt (1); - break; default: throw new ArgumentOutOfRangeException (nameof (part), part, null); } From ae7137549b0f916757a61ef2ea770210ce420f99 Mon Sep 17 00:00:00 2001 From: Tig Date: Tue, 3 Sep 2024 09:48:36 -0600 Subject: [PATCH 3/9] Updated nuget packages --- CommunityToolkitExample/CommunityToolkitExample.csproj | 2 +- Terminal.Gui/Terminal.Gui.csproj | 8 ++++---- UnitTests/UnitTests.csproj | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CommunityToolkitExample/CommunityToolkitExample.csproj b/CommunityToolkitExample/CommunityToolkitExample.csproj index 8a25e7c319..d99cc7b27e 100644 --- a/CommunityToolkitExample/CommunityToolkitExample.csproj +++ b/CommunityToolkitExample/CommunityToolkitExample.csproj @@ -8,7 +8,7 @@ - + diff --git a/Terminal.Gui/Terminal.Gui.csproj b/Terminal.Gui/Terminal.Gui.csproj index 4feaf3ae56..0c2cdc22fd 100644 --- a/Terminal.Gui/Terminal.Gui.csproj +++ b/Terminal.Gui/Terminal.Gui.csproj @@ -54,12 +54,12 @@ - - - + + + - + diff --git a/UnitTests/UnitTests.csproj b/UnitTests/UnitTests.csproj index 2db4a40178..e6f3fa620f 100644 --- a/UnitTests/UnitTests.csproj +++ b/UnitTests/UnitTests.csproj @@ -30,8 +30,8 @@ - - + + From 842b246e68f4be26f90293327d3c20341e7fe6f4 Mon Sep 17 00:00:00 2001 From: Tig Date: Tue, 3 Sep 2024 10:01:27 -0600 Subject: [PATCH 4/9] fixed bug correctly --- UnitTests/View/Layout/Dim.Tests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitTests/View/Layout/Dim.Tests.cs b/UnitTests/View/Layout/Dim.Tests.cs index 004ee2c971..a559e3361f 100644 --- a/UnitTests/View/Layout/Dim.Tests.cs +++ b/UnitTests/View/Layout/Dim.Tests.cs @@ -342,7 +342,7 @@ public void Only_DimAbsolute_And_DimFactor_As_A_Different_Procedure_For_Assignin #if DEBUG Assert.Equal ("Combine(Fill(Absolute(0))-Absolute(2))", v2.Height.ToString ()); #else - Assert.Equal ("Combine(Fill(Absolute(0)-Absolute(2))", v2.Height.ToString ()); + Assert.Equal ("Combine(Fill(Absolute(0))-Absolute(2))", v2.Height.ToString ()); #endif Assert.Equal (47, v2.Frame.Width); // 49-2=47 Assert.Equal (89, v2.Frame.Height); // 98-5-2-2=89 From e9d34b4c632c1cb575fb907760310966b5e1751b Mon Sep 17 00:00:00 2001 From: Tig Date: Tue, 3 Sep 2024 10:53:09 -0600 Subject: [PATCH 5/9] Update CommunityToolkitExample.csproj --- CommunityToolkitExample/CommunityToolkitExample.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CommunityToolkitExample/CommunityToolkitExample.csproj b/CommunityToolkitExample/CommunityToolkitExample.csproj index d99cc7b27e..fad50dccd3 100644 --- a/CommunityToolkitExample/CommunityToolkitExample.csproj +++ b/CommunityToolkitExample/CommunityToolkitExample.csproj @@ -8,7 +8,7 @@ - + From b9efc3e613a0ca11309bc723425d256fed43a483 Mon Sep 17 00:00:00 2001 From: Tig Date: Tue, 3 Sep 2024 10:55:47 -0600 Subject: [PATCH 6/9] Update UnitTests.csproj --- UnitTests/UnitTests.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UnitTests/UnitTests.csproj b/UnitTests/UnitTests.csproj index e6f3fa620f..c574ea37c5 100644 --- a/UnitTests/UnitTests.csproj +++ b/UnitTests/UnitTests.csproj @@ -30,8 +30,8 @@ - - + + @@ -81,4 +81,4 @@ False - \ No newline at end of file + From 7cfbf988f7e555e05aa854078978fd0bea64389a Mon Sep 17 00:00:00 2001 From: Tig Date: Tue, 3 Sep 2024 10:54:22 -0600 Subject: [PATCH 7/9] Update Terminal.Gui.csproj --- Terminal.Gui/Terminal.Gui.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Terminal.Gui/Terminal.Gui.csproj b/Terminal.Gui/Terminal.Gui.csproj index 0c2cdc22fd..500b798b33 100644 --- a/Terminal.Gui/Terminal.Gui.csproj +++ b/Terminal.Gui/Terminal.Gui.csproj @@ -141,4 +141,4 @@ true Miguel de Icaza, Tig Kindel (@tig), @BDisp - \ No newline at end of file + From 4c44f65927a75a21235c1963eb3fdf19af35c439 Mon Sep 17 00:00:00 2001 From: Tig Date: Tue, 3 Sep 2024 10:57:02 -0600 Subject: [PATCH 8/9] Update CommunityToolkitExample.csproj --- CommunityToolkitExample/CommunityToolkitExample.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CommunityToolkitExample/CommunityToolkitExample.csproj b/CommunityToolkitExample/CommunityToolkitExample.csproj index fad50dccd3..8a25e7c319 100644 --- a/CommunityToolkitExample/CommunityToolkitExample.csproj +++ b/CommunityToolkitExample/CommunityToolkitExample.csproj @@ -8,7 +8,7 @@ - + From 36dbebbf2640bf4988a5cec8dda81c0131cecf35 Mon Sep 17 00:00:00 2001 From: Tig Date: Tue, 3 Sep 2024 10:58:20 -0600 Subject: [PATCH 9/9] Update Terminal.Gui.csproj --- Terminal.Gui/Terminal.Gui.csproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Terminal.Gui/Terminal.Gui.csproj b/Terminal.Gui/Terminal.Gui.csproj index 500b798b33..2ff2b0e99a 100644 --- a/Terminal.Gui/Terminal.Gui.csproj +++ b/Terminal.Gui/Terminal.Gui.csproj @@ -54,12 +54,12 @@ - - - + + + - +