一次格式化 Visual Studio 项目中的所有文件 [英] Formatting - at once - all the files in a Visual Studio project

查看:47
本文介绍了一次格式化 Visual Studio 项目中的所有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣一次性格式化 Visual Studio(2005 版)项目中的所有文件.

I am interested in formatting all the files in a Visual Studio (ver. 2005) project all at once.

目前,有一种方法可以通过 Edit->Advanced->Format Document 来格式化单个文档.但是,我没有看到一个命令可以一次格式化项目的所有文件.

Currently, there is a way to format a single document by doing something like Edit->Advanced->Format Document. However, I don't see a single command to format all the files of a project all at once.

知道怎么做吗?

推荐答案

Tim Abell 在他的 博客:

Tim Abell wrote a macro to do this on his blog:

这是我今天拼凑的一个方便的 Visual Studio 宏脚本.它对列出的文件类型的每个文档运行编辑、格式化文档".

Here's a handy macro script for visual studio I knocked together today. It runs "edit, format document" on every document of the listed file types.

您必须密切注意它,因为它是交互式的,有时会弹出一条消息并等待答复.

You have to keep an eye on it as it's interactive and does sometimes pop up a message and wait for an answer.

您可以在 https://github.com/timabell/vs- 获取 vb 文件格式化宏更多信息请访问 https://github.com/timabell/vs-formatter-macro/wiki

You can get the vb file at https://github.com/timabell/vs-formatter-macro More info at https://github.com/timabell/vs-formatter-macro/wiki

原始代码可在博文中找到.请注意,这比上面 github 上提供的版本旧.

The original code is available at the blog post. Note that this is older than the version available on github above.

这篇关于一次格式化 Visual Studio 项目中的所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆