Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show source code for selected class name in editor in IntelliJ 2018.1

Through Maven, I have the source code and JavaDoc both downloaded for libraries used by my code.

I want to select a class name called in my code in the IntelliJ code editor, and then ask IntelliJ to show me the source code for that particular class.

Bonus: Show the JavaDoc for that class.

I thought F1 key would do this, but no so.

If a keyboard shortcut is required, please indicate the macOS version as well as the PC version if known.

like image 306
Basil Bourque Avatar asked Oct 17 '25 22:10

Basil Bourque


1 Answers

Hold Command key, hover mouse, and click

On a Mac, hold down the Command key. Notice as you move the mouse pointer, the class names change to blue underscored text like an old-school web page link. Click that retro-link while holding down Command.

I am guessing, per comment by Justice, that on a PC you would hold down Control key while hovering/clicking.

No need to select the class name.

Before, no keys pressed

enter image description here

After, pressing Command while hovering mouse pointer

enter image description here

Click the apparent link to open the local copy of class source code.

This approach worked on IntelliJ 2018.1 on macOS Sierra.

like image 174
Basil Bourque Avatar answered Oct 20 '25 12:10

Basil Bourque



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!