在 Visual Studio 编辑器中可视化错误位置
我正在寻找一种在 Visual Studio 中可视化编译器错误的方法。
我正在使用 C# 工作,并在 C# 的高级文本编辑器选项中打开了“编辑器中的下划线错误”。然而,下划线不是很明显,因此在滚动代码时很难看到它们。
在构建过程中,我得到了编译器错误列表,但最好在构建之前看到错误。
目前,例如我必须删除一个类变量。该变量在多个地方使用,如果有更好的方法来查看它们在哪里,我可以在构建之前快速修复所有错误。
一种方法是在滚动条中显示红色勾号,但我在首选项中没有找到类似的内容。
有没有更好的方法来查看 Visual Studio 中的错误位置?
I'm looking for a way to visualize compiler errors in Visual Studio.
I'm working in C# and have "Underline errors in the editor" turned on in C#'s advanced text editor options. However the underlines are not very noticeable, so it's hard to catch them when scrolling through the code.
During build I get a list of compiler errors, but it would be nice to see the errors before building.
Currently for example I have to remove a class variable. The variable was used in several places, I could quickly fix all errors before building if there was a better way to see where they were.
One way would be to show a red tick in the scroll bar, but I didn't find anything like that in the preferences.
Is there a better way to see where the errors are in Visual Studio?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
错误列表窗口应该会向您显示IDE 发现的所有实时语义错误的方式与显示构建后发现的错误的方式相同。
键盘快捷键 CTRL+SHIFT+F12 ( View.NextError)应该循环浏览该列表中的错误,并应该调整代码编辑器窗口以将焦点集中在问题行上。
The Error List window should show you all the live semantic errors the IDE has found in the same way that it shows you errors the build found after a build.
The keyboard shortcut CTRL+SHIFT+F12 (which is View.NextError) should cycle through the errors in that list and should adjust the code editor window to focus on the problem line.
简单的。我为此使用了 2 个扩展:
Error Lens (usernamehw.errorlens) 用于突出显示整行并实时显示错误诊断
Error Gutters (igorsbitnev.error-gutters)将错误图标放在行号旁边
两者看起来都是这样的:
Simple. I use 2 extensions for that:
Error Lens (usernamehw.errorlens) for highlight the entire line and show on real time the error diagnostic
Error Gutters (igorsbitnev.error-gutters) for put error icons next of line number
Both look like this: