将艺术风格与 Visual Studio 2010 集成
是否可以将艺术风格与 Visual Studio 2010 集成?与包含 Visual Studio 代码格式化程序相比,它在修复损坏的代码缩进和样式方面做得更好。理想情况下是热键或将其应用到当前文件的东西。我知道如何手动应用它,但必须有一个插件或可用的东西来帮助自动完成它。
Is it possible to integrate Artistic Style with Visual Studio 2010? It does a much better job of fixing mangled code indenting and styling than the include visual studio code formatter. Ideally a hotkey or something to apply it to the current file. I know how to apply it by hand but there must be a plugin or something available to help to do it automatically.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以将外部工具添加到 IDE。请参阅“工具”菜单。您可以让艺术风格为您格式化整个文件。它有点脆弱,因为您必须在运行外部命令之前保存文件。
您可以将击键绑定到外部命令。查看“工具”->“工具”中的“Tools.ExternalCommandN”(其中“N”是 1 到 24)。定制->键盘。
You can add external tools to the IDE. See the Tools menu. You can have Artistic Style format an entire file for you. It is a bit brittle, because you have to save the file before you run the external command.
You can bind a key stroke to the external command. Look at
Tools.ExternalCommandN
(whereN
is 1 to 24) in Tools -> Customize -> Keyboard.Visual Studio 支持外部工具:
http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k%28VS.EXTERNALTOOLS%29&rd=true
配置它与
$(ItemPath)
作为参数工作得很好。您可以在其前面添加其他选项,如下所示:-A12 $(ItemPath)
。Visual Studio supports external tools:
http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k%28VS.EXTERNALTOOLS%29&rd=true
Configuring it with
$(ItemPath)
as Arguments works just fine. You can add other options in front of it like that:-A12 $(ItemPath)
.现在有一个适用于 Visual Studio 2010/2012 的“AStyle Extension”插件,您可以通过内置的 Visual Studio 扩展管理器(工具 -> 扩展和更新)下载并安装该插件。它包括一个配置对话框,可让您控制所有选项。
有关此插件的更多信息,请参见:
http://visualstudiogallery.msdn.microsoft.com/2f3f04cd-2866-4e47-a671-d1cc9cc3fb02
There's now an "AStyle Extension" plugin for Visual Studio 2010/2012 that you can download and install via the built-in Visual Studio extension manager (Tools -> Extensions and Updates). It includes a configuration dialog that lets you control all the options.
There's more information on this plugin here:
http://visualstudiogallery.msdn.microsoft.com/2f3f04cd-2866-4e47-a671-d1cc9cc3fb02