Xavalon / XamlStyler

Visual Studio extension to help format your XAML source code
Apache License 2.0
1.15k stars 125 forks source link

Request to Add Option for Displaying Similar Properties on the Same Line in XamlStyler #496

Open Sia819 opened 2 weeks ago

Sia819 commented 2 weeks ago

I am using XamlStyler, and currently, similar properties such as Height and Width are displayed on separate lines. I would like to see an option that allows for these similar properties to optionally appear on the same line. For instance, HorizontalAlignment and VerticalAlignment should also be able to be displayed on the same line.

Current Behavior: image

Desired Behavior: image

Environment:

grochocki commented 2 weeks ago

This should be achievable with existing settings. Check out Separate By Groups (set to true) in conjunction with Attribute Tolerance (set to higher than your largest Attribute Ordering Rule Group).

Sia819 commented 2 weeks ago

Thanks to your suggestion, I changed Separate by groups to True, allowing properties with similar characteristics to be displayed across multiple lines, which resolved the issue I was facing. However, while defining the order for Attribute ordering rule groups, I encountered a problem when the line *:*, * appears. Due to the Separate by groups setting, all properties that aren't predefined start to display on the same line.

Could you suggest a way to address this phenomenon? I've looked for similar issues but haven't found a solution that fits, as seen in https://github.com/Xavalon/XamlStyler/issues/268.

Thank you for your continued support!

grochocki commented 2 weeks ago

Hmm, that might require a change. Either tweak behavior of Separate By Groups to always special case the default wildcard group so it does not group those or create a separate setting to do so.