Skip to content

Commit 5984a3c

Browse files
authored
Fixes #3941 - v2win/v2net: UICatalog crash - Fixes warnings (#3946)
* Tons of API doc updates * Adjust timeout * Code cleanuyp * Disabled All_Scenarios_Benchmark * Removed logs * Fixed a bunch of warnings * Fixed a bunch of warnings2 * Disabled All_Scenarios_Benchmark again...just to make sure * Enabled All_Scenarios_Benchmark again...It is not the culprit
1 parent b0f3281 commit 5984a3c

File tree

17 files changed

+60
-50
lines changed

17 files changed

+60
-50
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,10 @@ demo.*
6161

6262
logs/
6363

64-
log.*
64+
BenchmarkDotNet.Artifacts/
65+
66+
*.log
67+
68+
*.log.*
69+
70+
log.*

Terminal.Gui/Application/Application.Initialization.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ internal static void InternalInit (
167167
InitializedChanged?.Invoke (null, new (init));
168168
}
169169

170+
[RequiresUnreferencedCode ("AOT")]
171+
[RequiresDynamicCode ("AOT")]
170172
internal static void InitializeConfigurationManagement ()
171173
{
172174
// Start the process of configuration management.

Terminal.Gui/Configuration/ConfigurationManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,16 +327,16 @@ public static void PrintJsonErrors ()
327327

328328

329329
/// <summary>
330-
/// Logs any Json deserialization errors that occurred during deserialization to the logging system.
330+
/// Logs Json deserialization errors that occurred during deserialization.
331331
/// </summary>
332332
public static void LogJsonErrors ()
333333
{
334334
if (_jsonErrors.Length > 0)
335335
{
336-
Logging.Warning (
336+
Logging.Error (
337337
@"Encountered the following errors while deserializing configuration files:"
338338
);
339-
Logging.Warning (_jsonErrors.ToString ());
339+
Logging.Error (_jsonErrors.ToString ());
340340
}
341341
}
342342

Terminal.Gui/ConsoleDrivers/AnsiResponseParser/Keyboard/CsiKeyPattern.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public CsiKeyPattern ()
5353
}
5454

5555
/// <summary>
56-
///
56+
/// Called by the base class to determine the key that matches the input.
5757
/// </summary>
5858
/// <param name="input"></param>
5959
/// <returns></returns>

Terminal.Gui/ConsoleDrivers/V2/MainLoop.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ internal void IterationImpl ()
151151

152152
private void SetCursor ()
153153
{
154-
View? mostFocused = Application.Top.MostFocused;
154+
View? mostFocused = Application.Top!.MostFocused;
155155

156156
if (mostFocused == null)
157157
{

Terminal.Gui/ConsoleDrivers/V2/NetInputProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class NetInputProcessor : InputProcessor<ConsoleKeyInfo>
1717
/// </remarks>
1818
/// </summary>
1919
public static bool GenerateTestCasesForKeyPresses = false;
20-
#pragma warning enable CA2211
20+
#pragma warning restore CA2211
2121

2222
/// <inheritdoc/>
2323
public NetInputProcessor (ConcurrentQueue<ConsoleKeyInfo> inputBuffer) : base (inputBuffer, new NetKeyConverter ()) { }

Terminal.Gui/Drawing/Region.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ internal static List<Rectangle> MergeVerticalIntervals (SortedSet<(int yTop, int
658658
}
659659
else
660660
{
661-
result.Add (new (startX, currentTop.Value, endX - startX, currentBottom.Value - currentTop.Value));
661+
result.Add (new (startX, currentTop.Value, endX - startX, currentBottom!.Value - currentTop.Value));
662662
currentTop = yTop;
663663
currentBottom = yBottom;
664664
}

Terminal.Gui/Input/Keyboard/Key.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ public override bool Equals (object? obj)
418418
/// <param name="a"></param>
419419
/// <param name="b"></param>
420420
/// <returns></returns>
421-
public static bool operator != (Key a, Key? b) { return !a!.Equals (b); }
421+
public static bool operator != (Key? a, Key? b) { return !a!.Equals (b); }
422422

423423
/// <summary>Compares two <see cref="Key"/>s for less-than.</summary>
424424
/// <param name="a"></param>

Terminal.Gui/View/View.Content.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public ViewportSettings ViewportSettings
264264
/// </para>
265265
/// <para>
266266
/// Altering the Viewport Size will eventually (when the view is next laid out) cause the
267-
/// <see cref="Layout()"/> and <see cref="OnDrawingContent"/> methods to be called.
267+
/// <see cref="Layout()"/> and <see cref="OnDrawingContent()"/> methods to be called.
268268
/// </para>
269269
/// </remarks>
270270
public virtual Rectangle Viewport

Terminal.Gui/View/View.Drawing.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ private void DoDrawContent (DrawContext? context = null)
483483
return;
484484
}
485485

486+
// TODO: Upgrade all overrides of OnDrawingContent to use DrawContext and remove this override
486487
if (OnDrawingContent ())
487488
{
488489
return;
@@ -504,7 +505,7 @@ private void DoDrawContent (DrawContext? context = null)
504505
/// </summary>
505506
/// <param name="context">The draw context to report drawn areas to.</param>
506507
/// <returns><see langword="true"/> to stop further drawing content.</returns>
507-
protected virtual bool OnDrawingContent (DrawContext? context = null) { return false; }
508+
protected virtual bool OnDrawingContent (DrawContext? context) { return false; }
508509

509510
/// <summary>
510511
/// Called when the View's content is to be drawn. The default implementation does nothing.

0 commit comments

Comments
 (0)