XamlStyler icon indicating copy to clipboard operation
XamlStyler copied to clipboard

Format on save happens too late in Rider

Open viktorszekeress opened this issue 11 months ago • 1 comments

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

  1. Disable all 3 autosave checkboxes in Rider: Settings > Appearance & Behavior > System Settings
  2. Make sure there is no active 'Action on save': Settings > Tools > Actions on Save
  3. Open XAML file (tested with MAUI)
  4. Modify XAML so there there is something to format
  5. Press Ctrl + S
  6. You can see a blue indicator for pending (unsaved) changes next to file title in the tab
  7. 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 01_before_ctrl_s 2. Editor after save 02_after_ctrl_s 3. File on disk after save 03_after_ctrl_s

Version Info (please complete the following information):

  • OS: Windows 11
  • Visual Studio: Rider 2024.3.3
  • XAML Styler: Plugin (3.2411.0.0)

viktorszekeress avatar Jan 06 '25 19:01 viktorszekeress

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.

stevemonaco avatar May 27 '25 23:05 stevemonaco