简体   繁体   中英

Export VS formatting settings to MonoDevelop

I am working in a small team of developers (myself and one other), and we are working on different platforms (myself on Windows, him on Linux); this is intentional so that we can be sure that all features are completely cross-platform compatible. This means that he is working with MonoDevelop 5.9, and myself with Visual Studio Community 2013.

Since our code formatting options are slightly different, can I export my VS code formatting options for him to use in MonoDevelop? We have decided to use Unix line endings, and VS supports that so it's not an issue, but we always seem to have slightly different indentation, spacing, and bracketing settings.

MonoDevelop / Xamarin Studio has a matching C# Text Policy that can be applied to match the Visual Studio code style defaults.

In MD/XS, open up Preferences / Source Code / Code Formatting / C# source code

In that panel, you can select from the various built-in default styles, including 'Microsoft Visual Studio'. After selecting it, you can customize it if needed to match any changes that you might have made in VS.

If you need to reformat any source files after that selection is made, MD/XS has a menu command for reformatting to that style: Edit / Format / Format Document

The styles are stored in an XML-based file ( XamarinStudio-5.0 / Policies / Default.mdpolicy.xml ) but personally I do not know of this file format matching any Visual Studio file:

<TextStylePolicy inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/x-csharp">
</TextStylePolicy>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM