ReSharper, day 2: The color bar and the green box

Welcome to day 2 of my 31 Days of ReSharper.

So I talked about the grays in day 1. The next thing you’ll notice, after you install ReSharper, is the color bar.

ReSharper: green box
ReSharper: green box
ReSharper: green box

Whenever you’re editing a source file, a color bar will appear next to the vertical scroll bar. There’s a little box at the top, which can be green, yellow, or red. The ReSharper docs refer to this whole assemblage as the “marker bar”.

Wherever there’s a line of code with gray in it, ReSharper shows a little yellow tick mark. Wherever there’s a line of code with compiler errors, ReSharper shows a red tick mark. These are proportionally spaced throughout the bar (the color bar doesn’t scroll; its height represents your entire source file), so if you’ve got a source file with a lot of lines of code, the tick marks will be spaced closer together.

The little box at the top is there to quickly show you the status of the entire file. If there are any compiler errors (red ticks in the color bar) in this source file, the box is red. If there are no errors, but there are ReSharper warnings (yellow ticks in the color bar), the box is yellow. The object of the game is to make the box green.

ReSharper: green box

Of course, it doesn’t stop at pretty colors. ReSharper is there to help you code, and so it does. You can hover over one of the tick marks to see a hint, describing the problem. You can also click on a tick mark, which will position the cursor on the line of code in question.

Better yet, you can use F12 to move to the next problem in the file. (Shift+F12 moves to the previous problem.)

The only downside to this feature is that it’s per-file. There’s no easy way to see whether the entire project (or solution) has a green box, and pretty soon you’ll start wishing for that feature!

Here’s a tip: you can multi-select in Solution Explorer. So click on the first source file in your project, then Shift+click on the last one, and press Enter. This will open all your files in the editor, each in its own tab. Then start closing files (Ctrl+F4), keeping an eye on the color box. As soon as you hit one that’s not green, it’s time to get to work.

Leave a Reply

Your email address will not be published. Required fields are marked *