Wednesday, February 9, 2011

Fast compiler error messages in Eclipse

As a new Eclipse user, I am constantly annoyed by how long it takes compiler error messages to display. This is mostly only a problem for long errors that don't fit in the status bar or the "Problems" tab. But I get enough long errors in Java—especially with generics—that this is a nagging issue. (Note: The correct answer to this question is not "get better at using generics." ;-)

The ways I have found to display an error are:

  1. Press Ctrl+. or execute the command "Next Annotation". The next error is highlighted and its associated message appears in the status bar (if it is short enough). The error is also highlighted in the "Problems" tab, if it is open, but the tab is not automatically brought to the top.
  2. Hover the mouse over the error. After a noticeable lag, the error message appears as a "tool tip", along with any associated "Quick Fixes."
  3. Hover the mouse over the error icon on the left side of the editing pane. After a noticeable lag, all of the error messages for that line appear as a "tool tip." Clicking on the icon brings up "Quick Fixes."

What I would like is for Ctrl+. to automatically and instantly bring up the complete error message (I don't care where). Is this a configurable option?

[UPDATE] @asterite's "Ctrl+. F2" is almost it. How do I make "Next Annotation, then Show Tooltip Description" a macro bound to a single keystroke?

  • Well, you can press F2 to display the popup that normally shows javadoc. If there's an error, it will display the error message with available quick fixes.

    So you can do Ctrl+., F2 repeatedly to achieve what you want.

    From asterite
  • Yeah nagging problem. Ctrl+1 brings up the quick fixes if you use it from the same line. Sometimes I have to resort to copying the error message from the problems view :(

    From shyam
  • "After a noticeable lag, the error message appears as a "tool tip", along with any associated "Quick Fixes."

    Dont know if this will help you but you can reduce the lag in the pop up by changing the value of auto activation delay in the in the menu located at:

    Window>Preferences>Java>>Editor>ContentAssist
    
    Chris Conway : Changing the delay doesn't have any noticeable effect for me. Do I have to restart?
  • how we can see a detailed error in eclipse like this : Quote: estArrayDef.java:11: cannot find symbol symbol : variable object location: class TestArrayDef object.method(10); because i don't know how to do it

    From kate

0 comments:

Post a Comment