I would love to configure Visual Studio/ReSharper to run \"Code cleanup\" whenever I save a file.
A bonus would be to configure this only for C# files, as I sometime
Maybe this will help someone else out in the future. I really liked the Macro idea so I adopted it. But this was not enough for me. I wanted to save all the unsaved open files at once and still get to enjoy the ReSharper cleanup function. So I came up with this Macro:
Public Module SaveUtils
Public Sub CleanAndSave()
DTE.ExecuteCommand("ReSharper_SilentCleanupCode")
DTE.ActiveDocument.Save()
End Sub
Public Sub CleanAndSaveAll()
For i = 1 To DTE.Documents.Count
Dim document = DTE.Documents.Item(i)
If (Not document.Saved) Then
document.Activate()
CleanAndSave()
End If
Next i
End Sub
End Module