The generic parameters were double escaped and would display as `[[T0,T1,TRet]]` instead of `[T0,T1,TRet]`. This is because the `builder.AppendWithStyle` method already escapes its value so the caller must not escape the passed value.
and does not throw on unresolvable types.
Also changed the TypeResolverAdapter to adhere
to those expectations and removed the now no longer
needed try-catch from CommandPropertyBinder.
If the item contained escaped markup, after the call to RemoveMarkup
the string will contain unescaped markup (that the user explicitly had
escaped before) for those cases we need to escape all remaining markup.
* Invert `#if NET5_0` conditions so that when adding net6.0 target framework, the _new_ APIs are used.
* Use `NET5_0_OR_GREATER` instead of `NET5_0` to ensure consistent behaviour on future target frameworks.
When merging a large amount of segments together we were doing a tremendous amount of allocation especially related to strings due to concatination.
This adds an internal SegmentBuilder that uses a stringbuilder for building up the text rather than creating a new instance and doing a concat operation for each segment.
The style parameter is actually nullable. Also, the documentation of the style parameter has been made explicit that `Style.Plain` is used when a `null` style is passed.
When running on .NET Framework, the `Should_Report_Max_Remaining_Time_For_Extremely_Small_Progress` would intermittently fail with the following error:
```
task.RemainingTime
should be
10675199.02:48:05.4775807
but was
null
```
This is because it's possible that the two increment share the same timestamp thus making the `RemainingTime` null. To ensure the two increments don't share the same timestamp, we sleep for one millisecond.
Although I have only observed this issue on .NET Framework it would be possible that it occasionally also occur on .NET Core.
On .NET Framework, `exception.ToString()` uses a slightly different format than on .NET Core.
So in order to properly transform an `Exception` into an `ExceptionInfo` on both .NET Core and .NET Framework we use `exception.StackTrace` + `exception.InnerException`. As an added benefit, it greatly simplifies the implementation of the `ExceptionParser` class.
Since Spectre.Console targets .NET Standard 2.0 it makes sense to also run tests on .NET Framework (Windows only)
This makes two tests fail: `Should_Write_Exception_With_Inner_Exception` and `Should_Write_Exceptions_With_Generic_Type_Parameters_In_Callsite_As_Expected`.
Received (inner exception not handled):
```
System.InvalidOperationException: Something threw!System.InvalidOperationException: Throwing!
at Spectre.Console.Tests.Data.TestExceptions.MethodThatThrows(Nullable`1 number) in /xyz/Exceptions.cs:nn
at Spectre.Console.Tests.Data.TestExceptions.ThrowWithInnerException() in /xyz/Exceptions.cs:nn
```
Verified:
```
System.InvalidOperationException: Something threw!
System.InvalidOperationException: Throwing!
at Spectre.Console.Tests.Data.TestExceptions.MethodThatThrows(Nullable`1 number) in /xyz/Exceptions.cs:nn
at Spectre.Console.Tests.Data.TestExceptions.ThrowWithInnerException() in /xyz/Exceptions.cs:nn
at Spectre.Console.Tests.Data.TestExceptions.ThrowWithInnerException() in /xyz/Exceptions.cs:nn
at Spectre.Console.Tests.Unit.ExceptionTests.<>c.<Should_Write_Exception_With_Inner_Exception>b__3_0() in /xyz/ExceptionTests.cs:nn
at Spectre.Console.Tests.Unit.ExceptionTests.GetException(Action action) in /xyz/ExceptionTests.cs:nn
```
Currently, the latest stable .NET5 is version 5.0.400, which
fails with `latestPatch` but works with `latestFeature`.
Given that the project doesn't appear to depend on any low
level primitives or behaviors that might break from .NET
feature band upgrades, it's far more convenient for contributors
to have a more flexible requirement.
Test rending a table with East Asia characters (Chinese, Japanese, Korean).
The verified text file may look weird, but it looks normal and correctly in Console (tested in Windows Terminal, Terminal.app in macOS Monterey)