Is there a way to create Eclipse plugins with Python?

不问归期 提交于 2019-12-10 04:24:56

问题


As far as I understand Eclipse doesn't provide user with python bindings by default. Nor any projects of such kind was I able to find with google.

Are there any third-party plugins for that? Any tutorial? May be with Jython?..


回答1:


As far as I know, you need to use Java. Eclipse is written in Java, and even the vanilla application is made up of several Java components glued together by the core plugin loader. Jython might work if:

  • you can cross-compile Python to Java bytecode (indeed you can, thanks to sayth for pointing that out), and
  • you can access the Eclipse APIs inside Jython.

So, here's more or less what your plugin's architecture might look like. If you can get at the Eclipse APIs, then you can write most of it in Jython, and then make a Java wrapper for it with the Embedding Jython instructions.

If you can't get the Eclipse functionality into your Jython, then you can still write some of your code in python, and then have the Eclipse API access happening on your Java layer. This will be annoying in proportion to how evenly split your code is between python and Java. I've worked on a project before where we embedded python into C++ (or it might have been the other way around...), and it's a major headache if you don't plan it out right.



来源:https://stackoverflow.com/questions/7571235/is-there-a-way-to-create-eclipse-plugins-with-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!