2

I'm working on a Gradle plugin. Sometimes I want to look at the source code or Javadocs of Gradle's own classes. I want to do it from IntelliJ IDEA, without having to open a separate application. That is, Ctrl+click or Ctrl+B on a Gradle method or class and have IntelliJ open the source code of Gradle itself.

I have tried everything from Attaching Gradle sources in IntelliJ IDEA :

  • adding wrapper { ... } block in build.gradle
  • file gradle/wrapper/gradle-wrapper.properties has distribution type all (and, to my knowledge, has never had other distribution type on this particular machine)

I have also tried attaching sources manually by downloading Gradle source code from GitHub, but IntelliJ doesn't seem to be able to ingest it.

In addition to that, I have tried standard troubleshooting remedies of IntelliJ:

  • Refresh Gradle project
  • File > "Invalidate Caches / Restart" > "Invalidate and Restart"

Yet, when I click on method project.getProperties() (as an example), IntelliJ IDEA opens decompiled Project.class instead of the source code file Project.java.

How to make IntelliJ IDEA open Gradle's own source code?

andrybak
  • 2,129
  • 2
  • 20
  • 40
  • Both JavaDoc and "go to declaration/implementation" for Gradle resources are working fine for me (both for plugins and for normal consumer projects in both Groovy and Kotlin DSL) in IntelliJ Ultimate 2020.3 with Gradle 6.x. I didn't do anything special, except using the `all` distribution type as you mention. – Bjørn Vester Dec 15 '20 at 10:47

1 Answers1

2

Looks like you are facing this issue: IDEA-197970.

Andrey
  • 15,144
  • 25
  • 91
  • 187