Configure those annoying tooltips in Eclipse to only popup on request

Whenever you hover over any piece of code in Eclipse, it pops up a tooltip that displays more information about the item, such as its declaration, variable values or Javadoc information, as in the example below.

Although useful at times, this becomes extremely annoying after a while, especially when you’re using your mouse to browse some code. Popup after popup of unwanted information keeps obscuring your view of the code, leading to some lengthy expletives and big productivity loss. It’s useful information, but not every time all the time, almost like your car’s GPS giving you directions to 10 different places at once while you’re still parked in the driveway.

Luckily there is a way to alleviate the problem and all it takes is changing some preferences in Eclipse. We don’t want to completely disable tooltips (they can be useful), so I’ll show you how to tell Eclipse to bring up the tooltips only when you request them.

Show tooltips only on request

To tell Eclipse to only show tooltips on request, do the following:

  1. Go to Window > Preferences > Java > Editor > Hovers.
  2. Select the Source item in the list. Make sure the entire row is highlighted and that the checkbox is selected.
  3. Move focus to the Pressed key modifier while hovering field, positioning the cursor at the end of the default value Shift. Press and release Ctrl. The value should now read Shift+Ctrl. If you made a mistake, just clear the field by pressing Backspace or Delete and try again.
  4. Select the Combined Hover item in the list.
  5. Move focus to the Pressed key modifier while hovering field and press Shift. The value should now read Shift.
  6. Click Ok to accept the changes.

The preferences should look something like this:

You should now notice the following:

  • If you want to show the Javadoc or the declaration of some element hold down Shift while hovering over the element.
  • Variable values won’t popup automatically anymore. To show a variable’s value in debug mode, press Shift and hover over the variable. This is probably the only time when it’s a bit of a hassle to press Shift, but the pros totally outweigh the cons here as I view variable values a lot less than the number of times annoying tooltips appear.
  • If you want to show a quick preview of a method’s code, press Ctrl+Shift and hover over the method. This is a nice feature combined with the tooltip enrichment Eclipse provides, so you can view a method’s code in a scrollable tooltip without having to navigate to the method and back again.

Other options – configure, disable or use the keyboard

You can, of course, choose your own modifier keys in Preferences, but these are the ones I found that work the best, especially given that Ctrl and a click is a way to go to an element’s declaration or implementation in Eclipse. I’ve found Shift to conflict the least with existing features and easy enough to use on a frequent basis. Keep in mind that 2 hovers can’t share the same modifier key (which is why we reassigned the Source hover to use Shift+Ctrl).

You can also disable tooltips completely by deselecting the Combined Hover checkbox in the preference above, but I’ve found the Shift key to be a nice middle ground so keep it enabled.

To get similar information using the keyboard, press F2 while the cursor’s positioned on the code. To show variable values in debug mode, press Ctrl+Shift+D. A nice tip if you’ve disabled tooltips completely.

Related tips

Support Eclipse On E

9 thoughts on “Configure those annoying tooltips in Eclipse to only popup on request

  1. Let me get this straight: You are annoyed by helpful Eclipse popups, yet you’ve got annoying SnapShots plugin in WordPress activated…

    • Thanks for pointing that out, christian. Apparently this is a WordPress.com feature called mShots, enabled by default on all WordPress.com blogs. I never knew that (a) it was enabled and (b) I could disable it for the blog. It should now be disabled.

      I normally disable the snapshot previews globally on WordPress blogs (Turn Site Previews Off), so never really noticed it on my blog. But this is only per browser/client and until you pointed it out, I never thought that it was an option you could set per blog.

      And as I point out in the post, the popups in Eclipse are useful, but just not all the time. I’d say I normally only use them 5-10% of the time, so the rest of the time they’re just in the way.

      Thanks again for the comment.

  2. Thanks for posting this Byron.

    At last was able to control the hovers, the way I want.

  3. Thank YOU, I was about to go crazy over this (who in their right mind leaves something so annoying in a product for years anyway?)

  4. Oh, thank you! Really thank you! That’s great, solved the biggest problem I had with eclipse for more than one year of using…