Fire Tips: Working with Build Messages

If you have worked with Fire a bit, you will have noticed that unlike most other IDEs, it has no "Error List". This is not an oversight, but by design.

Fire integrates error (and similar) messages in the jump bar, as well as directly, inline, with the code editor. Let's look at some common and best practices for working with build messages.

Typically, after a build finishes with errors or warnings, you will press ⌥⌘M (or "Messages|Show First Message" in the menu). This will cause Fire to jump to and highlight the first error message (if there were any errors), or the first warning/hint (if there weren't).

The message will be selected in the jump bar above the editor (which is relevant for further navigation, more on that in a bit), but more importantly, it will show the code file responsible for the first message, and highlight the error inline.

By default, Fire will show what we call the "short message". Most error messages come in two versions — one that spells out all the details, and one that is more concise, but omits details that can be gleaned from the code itself.

For example, since Fire highlights the misspelled "Strng" right in the editor, the short message of "Unknown Identifier" is enough to tell you, given context, what has been misspelled.

Sometimes, however, you do want to see the full error message. You can press ⌥⌘L to toggle between long and short messages:

Sometimes, more than one message has been reported for the same line. If that is the case, you will see a black box with two numbers on the very right, for example "1/2", indicating which message is shown.

You can use ⌥⌘-Left/Right to switch between the different messages, to review them all.

Moving on

Because the current message has been selected in the jump bar, you can now also use Fire's regular up-down navigation to move to the next message by pressing ^⌘-Down (or back to the previous with ^⌘-Up).

Fire will move to the next message in order – which might mean moving around in the same file, our going to a different part of your project altogether.

If you move around the current code file manually (say cursoring down to a different line), Fire will also automatically select different messages as you encounter them. If you, for example, fix one error cursor down a few lines to look at the next one and then press ^⌘-Down, Fire will already know you had moved on to a different error, and will now move one down the list from that one.

Other Shortcuts

Sometimes, you want to stay within the current file you are working in, and see the first message reported for that file. Say you're aware of errors elsewhere in your project, but don't want to focus on those right now. Adding Shift to the keyboard shortcut from above, ⌥⇧⌘M (or "Messages|Show First Message in Current File" in the menu) will get you there.

Also, in rare occasions, you might want to review the full build log to get a better understanding of several errors in relation to each other, or to see details about a specific build phase. Pressing ⌥⌘B (or "Messages|Show Build Log") will bring you to the build log view (as will selecting "Build Log" or clicking on the "Last build failed (5 errors)" message in the jump bar).

Showing the First Message Automatically

Finally, if you are so inclined, you can tell Fire to automatically jump to the first error when a build finishes. To do so, open the Preferences dialog (⌘,) and toggle "Show first error location when build fails with errors" option:

Personally, I don't like this, because I usually keep coding after hitting Build, and find it distracting (if not outright dangerous) when Fire switches views for me as soon as the first error comes in. I much rather hit ⌥⌘M manually when I'm ready.

But if you typically lean back and enjoy the view (or go for a sword fight) after starting a build, you might like this option.

On that same page in the preference dialog, you can also tell Fire to automatically show the build log, if that strikes your fancy.

marc hoffman

Chief Architect and CEO here at RemObjects Software. Project Manager for Elements and lead developer of Fire, our awesome new development environment for the Mac.

Curaçao