有没有办法用 Python 创建 Eclipse 插件?
据我了解,Eclipse 默认情况下不向用户提供 python 绑定。我也无法通过谷歌找到任何此类项目。
有没有第三方插件可以实现这个功能?有教程吗?可以和 Jython 一起吗?...
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?..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,你需要使用Java。 Eclipse 是用 Java 编写的,甚至普通应用程序也是由多个 Java 组件组成,这些组件通过核心插件加载器粘合在一起。如果满足以下条件,Jython 可能会起作用:
所以,这或多或少是你的插件架构的样子。如果您可以获取 Eclipse API,那么您可以在 Jython 中编写大部分内容,然后使用 嵌入 Jython 指令。
如果您无法将 Eclipse 功能添加到 Jython 中,那么您仍然可以用 python 编写一些代码,然后在 Java 层上进行 Eclipse API 访问。与你的代码在 python 和 Java 之间的平均分配程度成正比,这会很烦人。我之前做过一个项目,我们将 python 嵌入到 C++ 中(或者可能是相反的情况......),如果你没有正确规划它,那将是一个非常令人头痛的问题。
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:
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.