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

XamlStyler moves <!--#endregion--> wrongly #437

Closed
Baka632 opened this issue Aug 17, 2023 · 5 comments
Closed

XamlStyler moves <!--#endregion--> wrongly #437

Baka632 opened this issue Aug 17, 2023 · 5 comments

Comments

@Baka632
Copy link

Baka632 commented Aug 17, 2023

Describe the bug
When XAML source code contains <!--#endregion-->, XamlStyle moves it wrongly

Before formatting:

<!--#region Visual State Manager-->
<VisualStateManager.VisualStateGroups/>
<!--#endregion-->

After formatting:

<!--#endregion-->

<!--#region Visual State Manager-->
<VisualStateManager.VisualStateGroups/>

To Reproduce
Steps to reproduce the behavior:

  1. Format XAML source code that contains <!--#endregion-->
  2. See error

Expected behavior
<!--#endregion--> should follow the previous XAML element

Screenshots
Before:
image

After:
image

External Configuration
No

Version Info (please complete the following information):

  • OS: Windows 11 22H2 (22621.2134)
  • Visual Studio: VS 2022 (17.7.1)
  • XAML Styler: Extension (3.2208.1)

Additional context
No

@grochocki
Copy link
Contributor

Can you only reproduce this issue with VisualStateManager? If so, can you try setting ReorderVSM to "None" and see if you can still reproduce the issue?

@Baka632
Copy link
Author

Baka632 commented Aug 18, 2023

Yes, I can only reproduce this issue with VisualStateManager

And after setting ReorderVSM to "None", the issue disappeared.

@grochocki
Copy link
Contributor

Is leaving that setting as "None" feasible for your project? The challenge here is that the region could be around any arbitrary block of XAML.

@Baka632
Copy link
Author

Baka632 commented Aug 18, 2023

Yes it is feasible for my project.

Usually VisualStateManager is very long so I use region to keep my code tidy and I won't add other XAML element inside.

@grochocki
Copy link
Contributor

Thanks for confirming! Going to close this as wont fix for now as there is a viable workaround for handling VSM.

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