相当于 org.eclipse.jdt.core.IJavaElement 的 Python/PyDev 是什么?

发布于 2024-12-23 09:22:00 字数 487 浏览 3 评论 0原文

我有兴趣修改现有的跟踪时间的插件 - rabbit-eclipse花在编辑不同的 java 元素(类、方法等)上。该插件当前通过 org.eclipse.jdt.core.IJavaElement 接口。我想添加跟踪不同 Python 元素的能力。

我已经在 Eclipse 中安装了 PyDev 并查看了包含的 JAR 文件,但我无法弄清楚哪个类与 IJavaElement 等效(如果它存在的话)。

PyDev 相当于 IJavaElement 吗?

I am interested in modifying an existing plugin -- rabbit-eclipse -- that tracks time spent editing different java elements (classes, methods, etc.). The plugin currently tracks Java elements via the org.eclipse.jdt.core.IJavaElement interface. I would like to add the ability to track the different Python elements.

I have installed PyDev in Eclipse and looked through the included JAR files, but I'm unable to figure out which class would be the equivalent to IJavaElement (if it even exists).

What is the PyDev equivalent to IJavaElement?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淤浪 2024-12-30 09:22:00

PyDev 不提供 IJavaElement 的实际替代品...(即:它不提供基于此的选择)。

尽管如此,可能还有不同的方法可以工作......一种选择是听取常规文本选择并执行 org.python.pydev.editor.actions.PyMethodNavigation 中所做的操作,即使用 FastParser 从当前位置查找范围.firstClassOrFunction(doc, startLine, searchForward, pyEdit.isCythonFile()) - 这足以满足您的需求吗?

PyDev doesn't provide an actual replacement for IJavaElement... (i.e.: it does not provide selection based on that).

Still, there may be different approaches which may work... one choice would be hearing regular text selections and doing what's done in org.python.pydev.editor.actions.PyMethodNavigation, which is finding out the scope from the current location using FastParser.firstClassOrFunction(doc, startLine, searchForward, pyEdit.isCythonFile()) -- would that be enough for what you want?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文