lajos
lajos

Reputation: 25715

Visualize error location in Visual Studio editor

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?

Upvotes: 0

Views: 2234

Answers (2)

Patricio Villarroel
Patricio Villarroel

Reputation: 427

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:

enter image description here

Upvotes: 1

Frank Boyne
Frank Boyne

Reputation: 4580

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.

Upvotes: 2

Related Questions