In visual studio development environment when you use a library if you have the related pdb you can dig into their sources during debug. I wonder is there any way to have this f
If you use maven, there is a button "Download sourcec" on maven panel.
If you don't, you need to get sources of hibernate first, search on the internet. And then attach them: File -> Project Structure -> Libraries -> Your hibernate lib -> and attach source
Of course, quoting the documentation:
Libraries may optionally include the source code for the library classes as well as corresponding API documentation. [...] However, it adds the ability to use inline documentation extracted from the source code, and also to view the API documentation right from the IDE.
The documentation doesn't mention you can then debug external libraries, which is obviously also possible.
In order to add sources choose:
+
iconIf you are using build tool like maven, IntelliJ will automatically download and attach available source to all libraries, no manual work needed.
In my case, I had to add the JDK source files to the project as below.
Go to Project Structure -> SDKs -> Sourcepath
Use the Plus Sign on the right, and provide the path to your $JAVA_HOME/src.zip file.
Project Structure
| Libraries
(or Module Dependencies if libraries are defined there):
Then in the libries tab click on the plus mark:
Select the source type:
Then you have to select the source path and add the wanted libraries finally click apply!
Go to
➙ Implementation(s)
No one suggested the simple route with a context-menu:
import java.util.DesiredClass
Done! The source code of the DesiredClass
opens in a new tab.
This also works with selected class name in the body of your code.