SLaks / Rebracer

Saves editor formatting settings as part of each solution.
http://visualstudiogallery.msdn.microsoft.com/410e9b9f-65f3-4495-b68e-15567e543c58
44 stars 15 forks source link

Saving solution adds unwanted settings #11

Closed rprouse closed 9 years ago

rprouse commented 9 years ago

Scenario 1

  1. Right click on solution, add new Rebracer.xml
  2. Open Rebracer.xml and remove items that you don't want set with the solution, save.
  3. Close the solution or hit Save All.

Expected: Rebracer.xml is not changed Actual: Rebracer.xml is populated with all the settings it supports.

Scenario 2

  1. Open a solution with a Rebracer.xml file that has been pared down.
  2. Edit your Visual Studio options, even one that is not supported by Rebracer. In my case it was debugging settings.

Expected: Rebracer.xml is not changed Actual: Rebracer.xml is populated with all the settings it supports.

Why this is a problem

Many of the options that Rebracer adds are not formatting related, but have to do with the behavior of Intellisense, Outlining, etc. Changing settings like this will just annoy other developers on the team. I might like my files to open with outlining collapsed, but other people might prefer it otherwise. I should not be dictating those options to other developers.

SLaks commented 9 years ago

I currently auto-add all settings within a category. This allows it to automatically pick up new settings (which is especially relevant as Roslyn adds new formatting settings), and allows you to easily persist other settings categories simply by adding an empty element to the XML.

I think the better solution to you root issue is to add those settings to the exclusion list (https://github.com/SLaks/Rebracer/blob/master/Rebracer/Utilities/KnownSettings.cs#L48). Can you send a PR with the properties you want to exclude?

SLaks commented 9 years ago

Any properties in that list will be ignored on load and unchanged on save, but will not be removed from existing settings files.

rprouse commented 9 years ago

I will see what I can do. The list might be long though. I don't want to see anything that is not formatting related in the file. I don't feel I have the right to dictate the other settings to other developers.

SLaks commented 9 years ago

Thanks!

SLaks commented 9 years ago

I published v1.2 to the gallery.

CADbloke commented 8 years ago

I found a few more - see attached zip of a diff report between your ReBracer.xml and the one my VS2015 + R# generated. I will try to arrange a PR. I will also try to look into tabs and spaces as per my gist at https://gist.github.com/CADbloke/6206b1d4084a88473689

"Try"

html diff report ReBracerExtras.zip