Can't find sources for python-ce.jar when developing a plugin

Answered

Hi, I am trying to build a Pycharm/python-capable plugin, so far so good but I can't see the sources/docs of the python SDK.

So basically whenever I navigate to a definition in PythonCore (like for example PyClass) I get a decompiled class files with no docs/ all parameters named var etc... and when I press Download... I get : "Sources for 'python-ce.jar' not found".

Is there any way around this?

By the way, I've spend quite some time with building a java plugin and the experience was pretty neat, rarely had issues with docs.

Hope it will be the same for python.

Thanks

9 comments
Comment actions Permalink

Please show your build.gradle definition. Did you follow guide from https://plugins.jetbrains.com/docs/intellij/pycharm.html?

0
Comment actions Permalink

build.gradle

intellij {
version '2020.2.3'
type "PC"
updateSinceUntilBuild false
downloadSources true
plugins "python-ce"
}

plugin.xml

<depends>com.intellij.modules.lang</depends>
<depends>com.intellij.modules.python</depends>
<depends>com.intellij.modules.platform</depends>

The plugin is building fine thought, I just can't access the SDK sources/docs.

1
Comment actions Permalink

Just a little question: is the python-ce API closed source? Because even searching on the net I couldn't find any docs/sources about it. If so then it would be pretty difficult to use the API, and maybe I legally shouldn't. And considering it true, is it the same for the remaining languages (except Java which I already tried with success)?.

0
Comment actions Permalink

Python Community Edition is OSS, the sources are part of IntelliJ Community.

Please try removing this line from your build.gradle

> plugins "python-ce"

0
Comment actions Permalink

I tried, now all the python SDK isn't loaded/recognized.

And this dependency in the plugin.xml becomes invalid.

If you want I can submit a minimal repo.

0
Comment actions Permalink

I tried testing this project: https://github.com/JetBrains/intellij-sdk-code-samples/tree/main/product_specific

It builds fine but with no Python Psi support, which means for example PyClass/PyFile etc... aren't defined.

Adding:

intellij {
....
plugins "python-ce"
}

gives access to PyClass/PyFile etc... but with no sources docs, like this for instance:

As you see it is pretty much unclear what is what, and clicking on Download Sources... fails

Is it related to this?

https://plugins.jetbrains.com/docs/intellij/pycharm.html#configuring-plugin-projects-targeting-pycharm 

Because what I can understand from this is that I can't access sources of the sdk because they are non public.

Can you give me a link where I can find the repo of python-ce.jar? Because I couldn't find anything on google/github

Thanks again.

0
Comment actions Permalink

After some efforts, finally I found the repo: https://github.com/JetBrains/intellij-community/tree/master/python/

Now should I clone it and point to it with Choose Souces... (what about version conflicts!) or is there any easier method around?

0
Comment actions Permalink

Hello, indeed there are currently no source artifacts provided when targeting PyCharm explicitly. A workaround would be to target IC (IntelliJ Community Edition) and require matching Python plugin (https://plugins.jetbrains.com/plugin/631-python/versions) instead (see https://github.com/jansorg/pycharm-flake8/blob/master/build.gradle as sample)

0

Please sign in to leave a comment.