Mostly using R# to automatically refactor, with some manual
fixups where it wouldn't work automatically (e.g. xml comments
on fields) or some it seemed to miss.
Some minor code reformatting was also done on properties near
other stuff I was manually inspecting.
alpha04 has following changes:
- libmi.so is not included in this package. It will be brough
as a separate nuget package later.
- all unix runtimes are replaced by generic unix runtimes to
enable easier builds on new unix platforms.
Fix#1465
On Linux, it's common to use error stream (2) as an information stream.
There is no errors in this case, it's just a way to report info.
When PowerShell redirects error stream, it wraps all output from stream 2
in NativeCommandError ErrorRecord.
That doesn't happen for interactive experience (when there is no
redirection), but it shows up in logs, scripting and non-console
powershell hosts (i.e. PowerShell ISE).
Here we change the formatter, so we are keeping the ErrorRecords
objects, but we are changing their default representation.
If it's a NativeCommandError, we don't use the regular ErrorRecord
formatter. It allows us keep ErrorRecord object,
but in redirection case it will look exectly like on the screen.
Also, we are change NativeCommandErrorMessage to use one line per
ErrorRecord to enable this scenario.
We use a lot of reflection, and when you rename a member (e.g. when running
the code formatter), it doesn't detect references where you're using reflection.
By using nameof(), we can now find these references (e.g. a build break) instead
of failing at runtime.
I (Jason Shirk) ran https://github.com/dotnet/codeformatter with the default rules, basically:
codeformatter /nocopyright "/c:DEBUG,UNIX,CORECLR" @files.rsp
This caused a few problems building, which were fixed up manually.
Notable changes:
`this.` is removed unless needed to disambiguate.
private instance fields are renamed to have a `_` prefix.
private static fields are renamed to have a `s_` prefix.
I left some projects alone (like PackageManagement) and also left some generated code alone.
Due to virtual key codes on Windows, simple chords like Ctrl+] are not
recognized as such. Instead, the ConsoleKey is Oem6, and the KeyChar is
an control code.