45

In some IDEs, Intellij IDEA for example, pressing control + j will display the docstring like this question. How do I get similar functionality for VS code?

Gama11
  • 31,714
  • 9
  • 78
  • 100
Fermat's Little Student
  • 5,549
  • 7
  • 49
  • 70

5 Answers5

37

The best I've found is cmd + shift + space for mac

feupeu
  • 819
  • 7
  • 25
29

Settings

  • This three settings in the picture will help.
  • Click to thing that you want to its documentation with mouse
  • Use keybinding that given below

enter image description here

Show Hover

Show Hover

Definition Preview Hover

Definition Preview Hover

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
yEmreAk.com
  • 3,278
  • 2
  • 18
  • 37
  • 1
    Worth noting that you have to remove the control+K shortcut if you have the vim extension installed – Alex Li Sep 06 '21 at 17:20
19

Ctrl+K + control+I might work. You can change to your favorite hotkey combination by change setting in Keyboard Shortcuts (Ctrl+K + control+S)

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
14

There are 2 ways in Visual Studio Code (version 1.34.0) to show quick documentation:

  1. short version -> mouse hover elements which you want to lookup
  2. long version -> after short version appears, press 'ctrl' key twice (if you press 'ctrl' key once, the long version documentation appears as long as you hold the 'ctrl' key)
tjkn
  • 149
  • 1
  • 3
13

The VSCode shortcuts Command is Show Hover, just change it to ^ j or whatever and you are ready to go.

Don't forget to resolve the conflicting shortcuts if any.

longkai
  • 3,598
  • 3
  • 22
  • 24