"Download Sources" failed, can't see source code of python plugin

Answered

I am developing a PyCharm plugin, when I look at the sources for the python plugin, I see a bunch of decompiled class files.
 

public Ref<PyType> getReferenceType(@NotNull PsiElement referenceTarget, @NotNull TypeEvalContext context, @Nullable PsiElement anchor) {
    if (referenceTarget == null) {
        $$$reportNull$$$0(2);
    }

    if (context == null) {
        $$$reportNull$$$0(3);
    }

    return null;
}

 

I do see a banner:


But when I click “Download Sources”, it fails with:
 

4:54:11 pm: Executing 'ijDownloadSourcesabc92b3c-779'...
Calculating task graph as no cached configuration is available for tasks: ijDownloadSourcesabc92b3c-779
FAILURE: Build failed with an exception.
* What went wrong:
Configuration cache state could not be cached: field `__collectionProvider__` of task `:ijDownloadSourcesabc92b3c-779` of type `IjDownloadTask`: error writing value of type 'org.gradle.api.internal.provider.DefaultProperty'
> Could not resolve all files for configuration ':downloadSources_cc00b331-d50f-4fea-9f88-9e9ff07cf2e7'.
  > Could not find unzipped.com.jetbrains.plugins:python-ce:pycharmPC-PC-223.8836.43-withSources.
    Searched in the following locations:
      - https://repo.maven.apache.org/maven2/unzipped/com/jetbrains/plugins/python-ce/pycharmPC-PC-223.8836.43-withSources/python-ce-pycharmPC-PC-223.8836.43-withSources.pom
    Required by:
        project :
* Try:
> If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 793ms
Configuration cache entry discarded due to serialization error.
4:54:12 pm: Execution finished 'ijDownloadSourcesabc92b3c-779'.
```
0
2 comments

When using IntelliJ IDEA 2023.2 or later, it's necessary to enable sources downloading in IDE Settings.

Please follow: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#ide-configuration

1

I've activated that setting, reloaded the Gradle project and restarted IDEA, but still seeing the same decompiled classes, the same banner at the top of the file, and the same error when I click “Download Sources”

Here are the relevant properties, 

# IntelliJ Platform Artifacts Repositories -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html

pluginGroup = org.basedsoft.plugins.basedtyping
pluginName = basedtyping
pluginRepositoryUrl = https://github.com/KotlinIsland/basedtyping
# SemVer format -> https://semver.org
pluginVersion = 0.1.0

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 233
pluginUntilBuild = 233.*

# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType = IC
platformVersion = 2023.3.1

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins = PythonCore:233.11799.300

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 8.5

# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
kotlin.stdlib.default.dependency = false

# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
org.gradle.configuration-cache = true

# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
org.gradle.caching = true

And here is what I see when I navigate to any PyCharm class.

1

Please sign in to leave a comment.