在我的工作,我用C#代码处理大部分时下,用java洒不时。我绝对喜欢关于Eclipse(我知道使用它每天爱它,甚至更多的人)是一个复杂的代码格式,能够塑造代码到任何编码标准可以想象。是否有C#这样的工具? Visual Studio代码格式(键Crtl + K,键Crtl + D)是欠佳和了StyleCop只检查源不固定的。
In my work I deal mostly with C# code nowadays, with a sprinkle of java from time to time. What I absolutely love about Eclipse (and I know people using it daily love it even more) is a sophisticated code formatter, able to mould code into any coding standard one might imagine. Is there such a tool for C#? Visual Studio code formatting (Crtl+K, Crtl+D) is subpar and StyleCop only checks the source without fixing it.
我的梦想工具将从控制台运行(易包括在自动构建或预提交挂钩,并执行在Linux +单声道),有基于文本的文件配置易于存放在项目资源库和预览图形规则编辑器 - 就像Eclipse代码格式化程序
My dream tool would run from console (for easy inclusion in automated builds or pre-commit hooks and for execution on Linux + Mono), have text-file based configuration easy to store in a project repository and a graphical rule editor with preview - just like the Eclipse Code Formatter does.
推荐答案对于Visual Studio,看看 ReSharper的。这是一个真棒工具和一个明确的必须具备的。 4.0之后的版本有代码的格式,并且你正在寻找清理功能。还有用了StyleCop 插件整合,包括格式设置文件。你可能想代理史密斯插件还有,对于拼写检查标识符和评论。每个解决方案的格式设置文件,可以通过整个团队签入到版本控制系统和共享ReSharper的支持。代码清理键盘快捷键是按Ctrl + E C 。
For Visual Studio, take a look at ReSharper. It's an awesome tool and a definite must-have. Versions after 4.0 have the code formatting and clean-up feature that you are looking for. There's also plugin integration with StyleCop, including formatting settings file. You'll probably want Agent Smith plugin as well, for spell-checking the identifiers and comments. ReSharper supports per-solution formatting setting files, which can be checked into version control system and shared by the whole team. Keyboard shortcut for code cleanup is Ctrl+E C.
在香草的Visual Studio,当前文件即可自动格式化键Crtl + K 键Crtl + D 和按Ctrl + K 按Ctrl + F 格式所选文本
In 'vanilla' Visual Studio, current file can be automatically formatted with Crtl+K Crtl+D, and Ctrl+K Ctrl+F formats the selected text.
至于与使用的运行无处不在命令行工具提交挂钩,尝试 NArrange 的。它是免费的,可以同时处理整个目录和运行单以及对Microsoft.Net
As for a runs-everywhere command line tool to be used with commit hooks, try NArrange. It's free, can process whole directories at once and runs on Mono as well as on Microsoft.Net.
有些人也会用的艺术风格命令行工具,虽然它需要Perl和适用于C / C ++代码比用C#。
Some people also use Artistic Style command line tool, although it requires perl and works better with C/C++ code than with C#.
更多推荐
是否有C#的自动代码格式化?
发布评论