This is the natural extension of #513 which already removed a lot of regex parsing.
The `ExceptionParser` class is renamed into `ExceptionConverter` because there is no more string parsing performed at all. `Exception` is converted into `ExceptionInfo` and `StackFrame` is converted into `StackFrameInfo`.
I kept running into https://github.com/JosefPihrt/Roslynator/issues/833 when using Rider, but it seems this was fixed in version 3.2 thanks to a fix in how they are doing assemblies. Looks like this would also include benefits for people using VS2022 too
CommandOptions now has an IsHidden property that, when set to true, will cause the option to be hidden from the following cases:
- Help text using `-h|--help`
- Xml representations generated with the `cli xml` command
- Diagnostics displayed with the `cli explain` command
Hidden options can still be outputted with `cli explain` using the `--hidden` option that is also used to display hidden commands.
Fixes#631
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.
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.
If the user's environment didn't support unicode, we used
to fall back to using the AsciiTreeGuide if LineTreeGuide
was being used (which it is by default). This commit removes
that fallback since the characters used in LineTreeGuide is
covered by extended ASCII, which SHOULD be fine in almost all
scenarios.
Closes#324