MonoDevelop Tips: Inline Errors

In MonoDevelop 2.4, we introduced inline error markers, similar to Xcode. When you build, errors and warnings are shown inline in the code as message bubbles, though of course they also remain available as a list in the Error List pad.

An inline error message bubble

We do our best to make sure the message bubbles don’t become too intrusive, but remain usable. They are normally shown on the end of the line that they affect, but if they are too long, they will wrap onto a new line. If they are really long, they ellipsize, but the full error remains available on a tooltip. If there are multiple errors or warnings on one line, they collapse down to a single line with an indicator indicating how many there are. Clicking on this indicator or moving the caret into the line causes the bubble to expand over the lines below and show all the messages, and clicking on the indicator again or moving the caret out of the line causes the bubble to collapse.

A collapsible inline error message

Editing a line with a message bubble causes the bubble to dim slightly, to indicate that it’s probably no longer valid.

By default, message bubbles are shown for both warnings and errors, and MonoDevelop takes you to the first error immediately after the build. These behaviours are configurable in Preferences->Build, where you can configure what happens after the build: whether to jump to errors and warnings, or just errors, or not at all; whether to show the error pad automatically; and whether to show message bubbles for errors, for errors and warnings, or not at all.

The inline error options

There are several commands for working with message bubbles, accessible from the View->Message Bubbles menu. The Hide/Show Message Bubble command hides or shows all the message bubbles, and the Toggle Message Bubble command hides or shows just the message bubbles on the current line. The latter command is also accessible via the context menu in the text editor margin. When bubbles are hidden, the error marker in the margin will remain there until the next build.