简体   繁体   English

将VS格式设置导出到MonoDevelop

[英]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); 我在一个由开发人员(本人和另一个人)组成的小组中工作,我们在不同的平台上工作(Windows上是我自己,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. 这意味着他正在使用MonoDevelop 5.9,而我正在使用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? 由于我们的代码格式化选项略有不同,我可以导出我的VS代码格式化选项供他在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. 我们已经决定使用Unix行尾,而VS支持这一点,因此这不是问题,但是我们似乎总是在缩进,间距和包围设置方面稍有不同。

MonoDevelop / Xamarin Studio has a matching C# Text Policy that can be applied to match the Visual Studio code style defaults. MonoDevelop / Xamarin Studio具有匹配的C#文本策略,可将其应用于匹配Visual Studio代码样式默认值。

In MD/XS, open up Preferences / Source Code / Code Formatting / C# source code 在MD / XS中,打开“首选项” /“源代码” /“代码格式” /“ C#源代码”

In that panel, you can select from the various built-in default styles, including 'Microsoft Visual Studio'. 在该面板中,您可以从各种内置的默认样式中进行选择,包括“ Microsoft Visual Studio”。 After selecting it, you can customize it if needed to match any changes that you might have made in VS. 选择它之后,可以根据需要自定义它,以匹配您可能在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 如果在选择后需要重新格式化任何源文件,则MD / XS具有用于重新格式化为该样式的菜单命令: 编辑/格式化/格式化文档

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: 样式存储在基于XML的文件中( XamarinStudio-5.0 / Policies / Default.mdpolicy.xml ),但是我个人不知道与任何Visual Studio文件匹配的文件格式:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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