我有兴趣一次性格式化 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 项目中的所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!