VisualStudio 可以在每次打开文件时调整换行符和格式设置吗?
我正在与一个小团队合作,我们在以下风格之间平均分配:
public void Method() {
// code
}
并且:
public void Method()
{
// code
}
我知道我们每个人都可以设置 Visual Studio(2010 Professional)以将新行放置在我们想要的位置,但这只是在当时代码已编写。
是否可以在打开代码时(或通过运行外部工具?)根据当前用户的偏好重新格式化代码,或者我们是否真的需要对最佳样式进行长时间的辩论(或放弃任何一致代码的希望) )?
(注意:我不是在问哪种风格最好,请不要尝试回答这个问题。我们能否让 VS 通过自动将现有代码重新格式化为目前首选的风格来消除争论?)
感谢您的帮助!
I'm working with a small team, and we're fairly evenly split between the following styles:
public void Method() {
// code
}
and:
public void Method()
{
// code
}
I know we can each setup Visual Studio (2010 Professional) to place New Lines where we want them, but that's only at the time the code is authored.
Is it possible to have the code re-formatted when it's opened (or by running an External Tool?) to the current user's preference, or do we really need to have a long debate about the best style (or abandon any hope of consistent code)?
(note: I am NOT asking which style is best, please don't try answering that question. Just can we have VS eliminate the debate by automatically re-formatting existing code into the style preferred at the moment?)
Thanks for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以创建一个环境事件宏来做到这一点。此链接告诉您如何创建这些宏之一。
You can create an envrimental events macro to do just that. This link tells you how to create one of these macros.