Selaa lähdekoodia

Fixed warnings

Tig 11 kuukautta sitten
vanhempi
commit
5cdac86fea

+ 1 - 0
Terminal.Gui/Configuration/ConfigurationManager.cs

@@ -110,6 +110,7 @@ public static class ConfigurationManager
         TypeInfoResolver = SourceGenerationContext.Default
         TypeInfoResolver = SourceGenerationContext.Default
     };
     };
 
 
+    [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
     internal static readonly SourceGenerationContext _serializerContext = new (_serializerOptions);
     internal static readonly SourceGenerationContext _serializerContext = new (_serializerOptions);
 
 
     [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
     [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]

+ 1 - 1
Terminal.Gui/View/Layout/Dim.cs

@@ -49,7 +49,7 @@ using System.Numerics;
 ///             </item>
 ///             </item>
 ///             <item>
 ///             <item>
 ///                 <term>
 ///                 <term>
-///                     <see cref="Dim.Fill(int)"/>
+///                     <see cref="Dim.Fill(Dim)"/>
 ///                 </term>
 ///                 </term>
 ///                 <description>
 ///                 <description>
 ///                     Creates a <see cref="Dim"/> object that fills the dimension from the View's X position
 ///                     Creates a <see cref="Dim"/> object that fills the dimension from the View's X position

+ 1 - 1
Terminal.Gui/View/Layout/Pos.cs

@@ -333,7 +333,7 @@ public abstract record Pos
     /// <summary>
     /// <summary>
     ///     Indicates whether the specified type <typeparamref name="T"/> is in the hierarchy of this Pos object.
     ///     Indicates whether the specified type <typeparamref name="T"/> is in the hierarchy of this Pos object.
     /// </summary>
     /// </summary>
-    /// <param name="pos">A reference to this <see cref="Pos}"/> instance.</param>
+    /// <param name="pos">A reference to this <see cref="Pos"/> instance.</param>
     /// <returns></returns>
     /// <returns></returns>
     public bool Has<T> (out Pos pos) where T : Pos
     public bool Has<T> (out Pos pos) where T : Pos
     {
     {

+ 2 - 0
Terminal.Gui/View/View.Hierarchy.cs

@@ -1,10 +1,12 @@
 #nullable enable
 #nullable enable
 using System.Diagnostics;
 using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
 
 
 namespace Terminal.Gui;
 namespace Terminal.Gui;
 
 
 public partial class View // SuperView/SubView hierarchy management (SuperView, SubViews, Add, Remove, etc.)
 public partial class View // SuperView/SubView hierarchy management (SuperView, SubViews, Add, Remove, etc.)
 {
 {
+    [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
     private static readonly IList<View> _empty = new List<View> (0).AsReadOnly ();
     private static readonly IList<View> _empty = new List<View> (0).AsReadOnly ();
 
 
     private List<View>? _subviews; // This is null, and allocated on demand.
     private List<View>? _subviews; // This is null, and allocated on demand.

+ 2 - 2
Terminal.Gui/View/View.Layout.cs

@@ -451,7 +451,7 @@ public partial class View // Layout APIs
     ///         .
     ///         .
     ///     </para>
     ///     </para>
     ///     <para>
     ///     <para>
-    ///         If set to a relative value (e.g. <see cref="Dim.Fill(int)"/>) the value is indeterminate until the view has
+    ///         If set to a relative value (e.g. <see cref="Dim.Fill(Dim)"/>) the value is indeterminate until the view has
     ///         been initialized ( <see cref="IsInitialized"/> is true) and <see cref="SetRelativeLayout"/> has been
     ///         been initialized ( <see cref="IsInitialized"/> is true) and <see cref="SetRelativeLayout"/> has been
     ///         called.
     ///         called.
     ///     </para>
     ///     </para>
@@ -500,7 +500,7 @@ public partial class View // Layout APIs
     ///         .
     ///         .
     ///     </para>
     ///     </para>
     ///     <para>
     ///     <para>
-    ///         If set to a relative value (e.g. <see cref="Dim.Fill(int)"/>) the value is indeterminate until the view has
+    ///         If set to a relative value (e.g. <see cref="Dim.Fill(Dim)"/>) the value is indeterminate until the view has
     ///         been initialized ( <see cref="IsInitialized"/> is true) and <see cref="SetRelativeLayout"/> has been
     ///         been initialized ( <see cref="IsInitialized"/> is true) and <see cref="SetRelativeLayout"/> has been
     ///         called.
     ///         called.
     ///     </para>
     ///     </para>

+ 2 - 2
Terminal.Gui/Views/ColorPicker.cs

@@ -154,7 +154,7 @@ public class ColorPicker : View
         _tfName.Autocomplete = auto;
         _tfName.Autocomplete = auto;
 
 
         _tfName.HasFocusChanged += UpdateValueFromName;
         _tfName.HasFocusChanged += UpdateValueFromName;
-        _tfName.Accept += (_s, _) => UpdateValueFromName ();
+        _tfName.Accept += (s, _) => UpdateValueFromName ();
     }
     }
 
 
     private void CreateTextField ()
     private void CreateTextField ()
@@ -303,7 +303,7 @@ public class ColorPicker : View
         }
         }
     }
     }
 
 
-    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 the new value of Focused is true then it is an enter event so ignore
         if (e.NewValue)
         if (e.NewValue)

+ 1 - 1
Terminal.Gui/Views/Toplevel.cs

@@ -24,7 +24,7 @@ public partial class Toplevel : View
     /// <summary>
     /// <summary>
     ///     Initializes a new instance of the <see cref="Toplevel"/> class,
     ///     Initializes a new instance of the <see cref="Toplevel"/> class,
     ///     defaulting to full screen. The <see cref="View.Width"/> and <see cref="View.Height"/> properties will be set to the
     ///     defaulting to full screen. The <see cref="View.Width"/> and <see cref="View.Height"/> properties will be set to the
-    ///     dimensions of the terminal using <see cref="Dim.Fill"/>.
+    ///     dimensions of the terminal using <see cref="Dim.Fill(Dim)"/>.
     /// </summary>
     /// </summary>
     public Toplevel ()
     public Toplevel ()
     {
     {

+ 6 - 2
UICatalog/UICatalog.cs

@@ -5,6 +5,7 @@ using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Collections.ObjectModel;
 using System.CommandLine;
 using System.CommandLine;
 using System.Diagnostics;
 using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
 using System.Globalization;
 using System.Globalization;
 using System.IO;
 using System.IO;
 using System.Linq;
 using System.Linq;
@@ -55,9 +56,11 @@ public class UICatalogApp
     private static int _cachedScenarioIndex;
     private static int _cachedScenarioIndex;
     private static string? _cachedTheme = string.Empty;
     private static string? _cachedTheme = string.Empty;
     private static ObservableCollection<string>? _categories;
     private static ObservableCollection<string>? _categories;
+    [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
     private static readonly FileSystemWatcher _currentDirWatcher = new ();
     private static readonly FileSystemWatcher _currentDirWatcher = new ();
     private static ViewDiagnosticFlags _diagnosticFlags;
     private static ViewDiagnosticFlags _diagnosticFlags;
     private static string _forceDriver = string.Empty;
     private static string _forceDriver = string.Empty;
+    [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
     private static readonly FileSystemWatcher _homeDirWatcher = new ();
     private static readonly FileSystemWatcher _homeDirWatcher = new ();
     private static bool _isFirstRunning = true;
     private static bool _isFirstRunning = true;
     private static Options _options;
     private static Options _options;
@@ -406,7 +409,7 @@ public class UICatalogApp
             _diagnosticFlags = Diagnostics;
             _diagnosticFlags = Diagnostics;
 
 
             _themeMenuItems = CreateThemeMenuItems ();
             _themeMenuItems = CreateThemeMenuItems ();
-            _themeMenuBarItem = new ("_Themes", _themeMenuItems);
+            _themeMenuBarItem = new ("_Themes", _themeMenuItems!);
 
 
             MenuBar menuBar = new ()
             MenuBar menuBar = new ()
             {
             {
@@ -676,7 +679,7 @@ public class UICatalogApp
 
 
             ColorScheme = Colors.ColorSchemes [_topLevelColorScheme];
             ColorScheme = Colors.ColorSchemes [_topLevelColorScheme];
 
 
-            MenuBar!.Menus [0].Children [0].ShortcutKey = Application.QuitKey;
+            MenuBar!.Menus [0].Children! [0]!.ShortcutKey = Application.QuitKey;
 
 
             if (StatusBar is { })
             if (StatusBar is { })
             {
             {
@@ -783,6 +786,7 @@ public class UICatalogApp
 
 
         private void ConfigAppliedHandler (object? sender, ConfigurationManagerEventArgs? a) { ConfigChanged (); }
         private void ConfigAppliedHandler (object? sender, ConfigurationManagerEventArgs? a) { ConfigChanged (); }
 
 
+        [SuppressMessage ("Style", "IDE1006:Naming Styles", Justification = "<Pending>")]
         private MenuItem [] CreateDiagnosticFlagsMenuItems ()
         private MenuItem [] CreateDiagnosticFlagsMenuItems ()
         {
         {
             const string OFF = "View Diagnostics: _Off";
             const string OFF = "View Diagnostics: _Off";

+ 1 - 2
UnitTests/FileServices/FileDialogTests.cs

@@ -4,7 +4,7 @@ using Xunit.Abstractions;
 
 
 namespace Terminal.Gui.FileServicesTests;
 namespace Terminal.Gui.FileServicesTests;
 
 
-public class FileDialogTests (ITestOutputHelper output)
+public class FileDialogTests ()
 {
 {
     [Theory]
     [Theory]
     [InlineData (true)]
     [InlineData (true)]
@@ -787,7 +787,6 @@ public class FileDialogTests (ITestOutputHelper output)
                 return dlg.Subviews.OfType<TextField> ().ElementAt (0);
                 return dlg.Subviews.OfType<TextField> ().ElementAt (0);
             case FileDialogPart.SearchField:
             case FileDialogPart.SearchField:
                 return dlg.Subviews.OfType<TextField> ().ElementAt (1);
                 return dlg.Subviews.OfType<TextField> ().ElementAt (1);
-                break;
             default:
             default:
                 throw new ArgumentOutOfRangeException (nameof (part), part, null);
                 throw new ArgumentOutOfRangeException (nameof (part), part, null);
         }
         }