4

IntelliJ display Java code auto-completion suggestions in a drop-down menu after pressing CtrlSpace. All other IDEs manage to display the corresponding Javadoc if available. How to get IntelliJ to do that?

How to see JavaDoc in IntelliJ IDEA? refers to displaying it on a mouse hover event whereas I'm missing the Javadoc from code-completion suggestions.

Kalle Richter
  • 8,008
  • 26
  • 77
  • 177

1 Answers1

2

Once you put a dot and the suggestions appear, press F1 (which is the default shortcut for "Quick Documentation" in most keymaps). The documentation for the currently selected method then appears as a card as show in the image. Then you can either use the up/down arrow keys or start typing the method name to select it. The documentation card will reflect accordingly.

intellij quick documentation

You can also click on the pin icon on top right of the documentation card to expand it if required.

Bajal
  • 5,487
  • 3
  • 20
  • 25
  • Opens Firefox (the default web broser) on Ubuntu 18.04 for `System.getenv` and `String.format`. – Kalle Richter Oct 04 '18 at 23:30
  • 1
    Ok, go to your preferences window and search for "Keymap". Within that, search for "Quick documentation". See what is the shortcut for you. Here is how mine looks; https://imgur.com/a/K2gFsNY – Bajal Oct 04 '18 at 23:34
  • 1
    Also, on some laptops you may have to press Fn key to actually do an F1 – Bajal Oct 04 '18 at 23:37
  • 2
    That works (however, IntelliJ doesn't pick up the docs from the filesystem which makes it useless). Every IDE manages to display JDK Javadoc in the auto-completion popup. Why are people even considering IntelliJ? It took me 6 hours now to get basic things working that isn't necessary in _any_ other IDE. – Kalle Richter Oct 04 '18 at 23:43
  • CTRL-Q is the shortcut for quick documentation. Works in the editor, but also in the popups. – SurfMan Oct 05 '18 at 08:39