GithubHelp home page GithubHelp logo

jerriclynsjohn / rebracer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from slaks/rebracer

0.0 1.0 0.0 3.03 MB

Saves editor formatting settings as part of each solution.

Home Page: http://visualstudiogallery.msdn.microsoft.com/410e9b9f-65f3-4495-b68e-15567e543c58

rebracer's Introduction

#Rebracer

Rebracer solves an age-old problem with working on C# projects from a variety of source: source formatting settings. If you work on different open source projects, or on projects for different companies, each one is likely to have a different One True Brace Style, forcing you to change your Visual Studio settings every time you switch projects.

Rebracer solves this by storing these settings alongside each solution. When you open a solution, Rebracer will automatically apply that solution's settings, leaving you free to write code as usual.

##How it works Whenever you open a solution, Rebracer will check for a Rebracer.xml file in the solution directory. If it finds one, it will load all settings from that file so that the solution will use its specified settings. When you change settings in Visual Studio's regular Options dialog, Rebracer will update the XML file with the changed settings.

To use Rebracer for a new solution, right-click the solution, click Add, New Rebracer Settings File. This will create a Rebracer.xml for the solution, seeded with your current VS settings. You can then open the Options dialog to choose settings specific to that solution. From then on, anyone who opens that solution with Rebracer installed will get those settings. You can also copy an existing Rebracer.xml file from a different solution to start with its settings. If so, you must close and re-open the solution to pick up the new file.

##FAQ

  • Q: I want to contribute to a project that uses Rebracer. What do I need to do?
    A: Just install Rebracer from the Visual Studio Extension Gallery. That's it โ€“ you don't need to do anything else.

  • Q: Should I put Rebracer.xml in source control?
    A: Yes! The whole point of Rebracer is that people who check out your solution from source controll will get the same settings.

  • Q: Will this generate merge conflicts as people change settings?
    A: Rebracer maintains its settings files in a consistent manner (always sorted, ignoring extra properties) to avoid merge conflicts.

  • Q: What about tabs vs. spaces?
    A: Use the existing EditorConfig extension, which allows you to specify newline and whitespace settings for individual files or patterns, and works with most editors.
    If you want to maintain a single settings file, you can manually add <ToolsOptionsSubCategory name="CSharp"> under <ToolsOptionsCategory name="TextEditor"> in Rebracer.xml:

true ```
  • Q: Will this mess up my global settings for projects that don't use Rebracer?
    A: Nope! Rebracer maintains a separate XML file in your Visual Studio profile containing your original global settings. If you open or create a solution that doesn't have a Rebracer settings file, it will revert to your existing global settings.

  • Q: What settings are supported?
    A: Any settings saved in the <ToolsOptions> element of a VSSettings file (the DTE.Properties collections in extensibility). MSDN has a list of predefined categories.
    By default, Rebracer settings files only contain settings that are useful to roam with projects. If you edit the file manually, you can add other categories and they will be serialized too.

  • Q: Isn't this a security risk? What if I open a hostile project that includes a malicious settings file?
    A: Rebracer will refuse to apply any settings that have security implications, and will print a warning message in the Output window if such settings are encountered. See KnownSettings.cs for the list of dangerous settings.

  • Q: Why is the XML file so verbose?
    A: The XML file was designed to mirror Visual Studio's standard VSSettings files, which store user settings and are used by the Import/Export Settings wizard. Note that I have not actually tested this compatibility.

  • Q: Can I have different settings for different projects in a solution?
    A: No; sorry. (switching settings as you switch projects is far more complicated, and cannot work at all for non-editor-specific settings.) If you want to change newline or indentation settings on a per-project or even per-file basis, use EditorConfig.

  • Q: Can this work with MonoDevelop?
    A: Great question! I have no idea.
    Adding such compatibility would require a separate version of this extension for MonoDevelop, which would need to map property names from Visual Studio.

rebracer's People

Contributors

slaks avatar jansokoly avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.