After I recently released an updated version of Ookii.CommandLine, I figured Ookii.FormatC could also use some love.
This version comes with an optional new dark mode stylesheet, nullable reference types enabled for the library, the ability to write directly to a TextWriter
, C# 10.0 keyword support, and a few minor other features and fixes.
Thanks to the ability to write to a TextWriter
, you can now do stuff like this:
var formatter = new CodeFormatter() { FormattingInfo = new CSharpFormattingInfo() }; formatter.FormatCode(SampleCode, Console.Out);
Okay, writing HTML to the console is maybe not the most useful example, but you get the idea.
You can try it out with .Net Fiddle, or look at a sample that also shows the new dark mode in action. The online syntax highlighter has also been updated, and now supports PSParser
based PowerShell formatting again.
And yeah, the NuGet package is version 2.3.1, rather than 2.3.0. That's because somehow the package for 2.3.0 ended up with an outdated binary in it. Not sure how that's possible, but it happened.
No comments here...
Comments are closed for this post. Sorry.