csharpier icon indicating copy to clipboard operation
csharpier copied to clipboard

Add more options to CodeFormatterOptions

Open Phault opened this issue 1 year ago • 1 comments

I'm creating a wrapper plugin for integrating Csharpier with dprint, but I've hit a snag as the Csharpier.Core package only exposes CodeFormatterOptions, which currently only contains the setting for PrintWidth.

Would it be possible to get all the options exposed? I'm willing to create a PR to add this, although I'd prefer knowing the reasoning for the current split of CodeFormatterOptions and PrinterOptions first.

Phault avatar Feb 11 '24 13:02 Phault

If I recall correctly, I added CodeFormatterOptions when there was just the single option for width, and then missed adding tabs/indent size. PrinterOptions contains a lot of options that didn't make sense to expose in CSharpier.Core which I believe is why I split them originally.

I'm not in love the the names in PrinterOptions - I'm thinking that TabWidth changes to IndentSize on CodeFormatterOptions (to line up with the editorconfig name). And maybe UseTabs should be an enum called IndentStyle, but an enum for just two options could be overkill.

I have no problem exposing the options so go ahead with the PR.

belav avatar Feb 11 '24 21:02 belav