Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markup extension formatting no longer works #432

Closed
RandomEngy opened this issue Aug 1, 2023 · 2 comments
Closed

Markup extension formatting no longer works #432

RandomEngy opened this issue Aug 1, 2023 · 2 comments

Comments

@RandomEngy
Copy link
Contributor

Describe the bug
Markup extension formatting is not working. When running lately it undid all of the nice formatting that an earlier run had added.

image

To Reproduce
Format this XAML:

<RadioButton
	VerticalAlignment="Center"
	Content="{x:Static res:EncodingRes.Bitrate}"
	IsChecked="{Binding EncodeRateType,
						Converter={StaticResource EnumBoolConverter},
						ConverterParameter={x:Static model:AudioEncodeRateType.Bitrate}}" />

When formatted with Markup extension formatting enabled, it all gets combined into one line:

<RadioButton
	VerticalAlignment="Center"
	Content="{x:Static res:EncodingRes.Bitrate}"
	IsChecked="{Binding EncodeRateType, Converter={StaticResource EnumBoolConverter}, ConverterParameter={x:Static model:AudioEncodeRateType.Bitrate}}" />

Expected behavior
The IsChecked line stays formatted with multiple lines, with Converter and ConverterParameter each on its own line.

Version Info (please complete the following information):

  • OS: Windows 11
  • Visual Studio: 2022 17.6.4
  • XAML Styler: Extension 3.2111.0
@RandomEngy RandomEngy added the Bug label Aug 1, 2023
@grochocki
Copy link
Contributor

Can you confirm whether you have anything listed under the NoNewLineMarkupExtensions option? By default, this is set to x:Bind or Binding, which would prevent the desired formatting as described above. If I remove those, then formatting returns the following for me when FormatMarkupExtension is set to true.

<RadioButton
	VerticalAlignment="Center"
	Content="{x:Static res:EncodingRes.Bitrate}"
	IsChecked="{Binding EncodeRateType,
						Converter={StaticResource EnumBoolConverter},
						ConverterParameter={x:Static model:AudioEncodeRateType.Bitrate}}" />

@RandomEngy
Copy link
Contributor Author

Ahh, that was it, thanks!

The default was stopping formatting for that. The default seems odd because Binding is usually has the most verbose markup extensions for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants