IntelliJ - 显示代码弹出窗口时的方法说明和注释

时间:2017-09-18 07:48:18

标签: eclipse intellij-idea documentation markup

当我滚动到它们时,我希望可用方法的弹出窗口显示方法描述。

enter image description here

(显然,这仅在方法本身具有必要的注释和标记时才有效。)

/**
 * If a value is present in this {@code Optional}, returns the value,
 * otherwise throws {@code NoSuchElementException}.
 *
 * @return the non-null value held by this {@code Optional}
 * @throws NoSuchElementException if there is no value present
 *
 * @see Optional#isPresent()
 */
public T get() {

我希望它表现得像这样:

enter image description here

2 个答案:

答案 0 :(得分:1)

除了简单的完成查找外,您还可以访问Quick Definition View

所以,

  • CRTL + SPACE生成您在问题中显示的查询
  • 然后CRTL + SHIFT + SPACE显示Quick Definition View,例如:

enter image description here

这显示了可用的方法及其文档。

答案 1 :(得分:1)

使用CRTL + SPACE (control + SPACE in mac)选择方法后,您可以按CRTL + Q (F1 in mac)查看快速文档。