XamlStyler
XamlStyler copied to clipboard
Format on save happens too late in Rider
Describe the bug After pressing Ctrl + S to execute format and then save, the file is saved first and formatted afterwards, thus saved file doesn't contain formatted changes.
To Reproduce
- Disable all 3 autosave checkboxes in Rider: Settings > Appearance & Behavior > System Settings
- Make sure there is no active 'Action on save': Settings > Tools > Actions on Save
- Open XAML file (tested with MAUI)
- Modify XAML so there there is something to format
- Press Ctrl + S
- You can see a blue indicator for pending (unsaved) changes next to file title in the tab
- Open file from the disk to verify that your unformatted state got saved to disk, not formatted
Expected behavior XAML Styler formats file first and then executes save action. I now have to press Ctrl + S twice.
Screenshots
1: Editor before save
2. Editor after save
3. File on disk after save
Version Info (please complete the following information):
- OS: Windows 11
- Visual Studio: Rider 2024.3.3
- XAML Styler: Plugin (3.2411.0.0)
I'm still experiencing this with 3.2504.1.0 with Avalonia's XAML (.axaml). It's eventually going to force us to drop XamlStyler for the built-in Rider autoformatting or convince everybody to do git hooks.