如何让 Visual Studio 自动转到构建中的第一个错误?
这是通过转到“错误列表”输出窗口并双击第一个错误或按 F8 手动完成的。有没有办法自动执行此操作?
(如果重要的话,我正在使用 C++。)
This is done manually by going to the "Error List" output window and double-clicking on the first error or pressing F8. Is there a way to automate this?
(I'm using C++ if that matters.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
vittore 正在步入正轨...
在 VS 中按 Alt+F11 打开宏 IDE。在“MyMacros”下打开“EnvironmentEvents”模块,并在这三行下方
粘贴此子:
显然,您可以注释掉或删除蜂鸣声和消息框...
vittore is on track...
In VS press Alt+F11 to open the Macros IDE. Under 'MyMacros' open 'EnvironmentEvents' module and below these three lines
paste this Sub:
Obviously, you can comment out or delete the Beep and the message box...
添加到之前的答案:
我建议使用
View.NextError
命令而不是Edit.GoToNextLocation
。不要被它的组(View
)迷惑,它实际上转到编辑器中的错误位置,就像双击错误列表中的错误项一样。您还可以通过以下方式将其映射到键盘:
View.GoToPreviousError
View.GoToNextError
这将允许您检查错误(并在编辑器中在错误之间移动) )甚至不需要显示错误窗口,甚至不需要运行构建。
Adding to the previous answer:
I suggest
View.NextError
command instead ofEdit.GoToNextLocation
. Do not get confused by its group (View
), it actually GOes TO error location in the editor, like if you double-click error item in the error list.You can also map it to the keyboard this way:
View.GoToPreviousError
View.GoToNextError
This will allow you to check for errors (and move between them in editor) even without need of displaying the error window and even without running the build.