I suggest you ...

Store per-project source formatting settings with project properties

I wish it were possible to define per-project editor settings that affect formatting and writing style: tab size, use tabs/spaces, autoindent and so on.

Because, different solutions (or even projects in one solution) can have different coding styles or conventions.

Having to poke in several tabs of environment settings every time as I switch projects is a major annoyance.

Actually the formatting settings are not private user preferences; they are part of a project and should be stored in source sontrol, so that the next person that takes on the code automatically gets the proper settings.

438 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    p.a.p.a. shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    TomTom shared a merged idea: Add Solution wide settings  ·   · 

    23 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • PJTraillPJTraill commented  ·   ·  Flag as inappropriate

        While I think it would usually be preferable to treat them style as a project property, I am not convinced that that is ideal for every project: perhaps some teams are sufficiently laid back about style to allow everyone to do their own thing. I would make it optional but default that the project settings override user preferences.

      • SLaksSLaks commented  ·   ·  Flag as inappropriate

        To solve this problem, I wrote Rebracer, which stores source formatting settings in an XML file with each solution.

        Just install this Visual Studio extension, right-click your solution, and click Add, New Rebracer Settings File, then change options for that solution only.

        http://visualstudiogallery.msdn.microsoft.com/410e9b9f-65f3-4495-b68e-15567e543c58
        https://github.com/SLaks/Rebracer

      • David PooleDavid Poole commented  ·   ·  Flag as inappropriate

        I can't get EditorConfig to work at all. I'm using VS 2012 it seems to have no effect. Any tips?

      • SLaksSLaks commented  ·   ·  Flag as inappropriate

        EditorConfig is works fine per-project or per-solution.
        Its real problem is that it doesn't support source formatting settings.

      • Gulshanur RahmanGulshanur Rahman commented  ·   ·  Flag as inappropriate

        It will be useful to have per-project formatting settings, a global settings with option to override per-project settings and format according to per-project setting before pushing code to GIT or TFS.

      • Steve WilliamsSteve Williams commented  ·   ·  Flag as inappropriate

        EditorConfig is NOT an answer for this, for two reasons:
        - EditorConfig is for across IDEs, not per project or per solution.
        - EditorConfig requires Visual Studio Professional or higher.

        MonoDevelop does have per-project text editor settings that are stored in the project file, and is a good example of how it should be done in Visual Studio.

      • Chris PattersonChris Patterson commented  ·   ·  Flag as inappropriate

        So like R# does with per-solution settings? I hope per-solution is what was requested as I would hate to customer per project within the same solution.

      • AdeelAdeel commented  ·   ·  Flag as inappropriate

        This is extremely useful, especially in workflows with source control and lots of participants. For instance, open source repos on github, where people (other than the regular contributors) are sending pull requests and the code formatting quality is affected by different IDE settings.

      • SLaksSLaks commented  ·   ·  Flag as inappropriate

        EditorConfig only helps for indentation settings (tabs vs. spaces); we still need the ability to change other editor settings like autoformat behavior or Sort Usings settings.

      • p.a.p.a. commented  ·   ·  Flag as inappropriate

        Yes, EditorConfig is what is needed... at least, very close to it!
        p.a.

      • Olaf van der SpekOlaf van der Spek commented  ·   ·  Flag as inappropriate

        I vote for auto-detection too. What if a file is edited that's not part of an opened project/solution?
        Settings to trim trailing whitespace and for encoding and end of line style would be nice too.

      • Ian William James HallidayIan William James Halliday commented  ·   ·  Flag as inappropriate

        There should be settings at each level of granularity, projects, solutions, user (dropbox!). Each overrides the next.

        E.g. I have my typical settings that I prefer, but I open some OSS solution with different settings, so it overrides my settings. Further within this solution one particular project is inconsistent with the rest, so it has its own settings which override the solution's settings.

      • romrom commented  ·   ·  Flag as inappropriate

        I've always found it silly that VS treats formatting settings as a user preference, when clearly it's a per-project preference.

      ← Previous 1

      Feedback and Knowledge Base