I know this problem has been existing on and off for a long time. I think this used to work the last time I had to maintain our plugin (which was a few months ago).
Ok, now I know everything, thanks!
IntelliJ Platform sources are resolved by the Plugin DevKit from the IntelliJ Releases/Snapshot repositories by IDE, which creates a temporary task in your root project to fetch the -sources.jar and attach it to the IntelliJ Platform dependency.
Unfortunately, that works only when you have the mentioned repositories added, and in your case, the org.jetbrains.intellij.platform Gradle plugin is added to the plugin module only, along with the required
in order to get this working, you can apply the org.jetbrains.intellij.platform.settings in your settings.gradle.kts and define there all required repositories for all modules at once.
See the settings.gradle.kts of the IntelliJ Platform Plugin Template repository for more details.
I just realized I didn’t have the Plugin Devkit plugin installed (I only had the DevKit Runtime one) . Sorry about that - indeed after installing it I can confirm this works for me too!