关于类在 Eclipse 包中的位置的澄清

发布于 2024-11-12 23:37:27 字数 459 浏览 4 评论 0原文

如果之前有人问过这个问题,请忽略它。我正在研究在 org.eclipse.jdt.internal.ui.text.java 包中找到的 HippieProposalComputer 类来帮助我编写自己的插件。因此,我查看了依赖项列表,其中之一是 org.eclipse.ui.texteditor.HippieProposalProcessor,所以当我查找 org/eclipse/ui/texteditor 时,我是无法找到 HippieProposalProcessor 类。我执行了 grep -r HippieProposalProcessor 插件,该类位于包 org.eclipse.ui.workbench.texteditor 中,

所以我的问题是包 org.eclipse .ui.workbench 和 org.eclipse.ui 相同,因为当 Hippie 用于内容辅助时 Eclipse 永远不会抛出错误?

If that question was asked before, please disregard it. I was investigating the HippieProposalComputer class found in org.eclipse.jdt.internal.ui.text.java package to help me write my own plugin. So I looked at the list of dependencies and one of them is org.eclipse.ui.texteditor.HippieProposalProcessor so when I looked up org/eclipse/ui/texteditor I was not able to find the HippieProposalProcessor class. I perform a grep -r HippieProposalProcessor plugins and the class was in the package org.eclipse.ui.workbench.texteditor

So my question are the packages org.eclipse.ui.workbench and org.eclipse.ui the same since eclipse never throw an error when Hippie is used at content-assistor?

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

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

发布评论

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

评论(2

巷雨优美回忆 2024-11-19 23:37:27

您错误地认为包名称和插件名称紧密相连。他们不是。

在您的情况下,org.eclipse.ui.texteditor.HippieProposalProcessor 位于正确的包中,但在org.eclipse.ui.workbench.texteditor 插件中

最有可能的是,这是重构并将 org.eclipse.ui 插件拆分为多个较小插件的结果,从而产生了一个没有插件名称作为前缀的包。

You mistakenly assume that package names and plugin names are tight together. They are not.

In your case, the org.eclipse.ui.texteditor.HippieProposalProcessor is located in the correct package, but in org.eclipse.ui.workbench.texteditor plugin.

Most probably, this is a result of a refactoring and splitting the org.eclipse.ui plugin into multiple smaller plugins, which resulted in a package, which doesn't have its plugin name as prefix.

踏月而来 2024-11-19 23:37:27

那没关系。如果您查看源代码,就会发现 HippieProposalComputer 中有一个 org.eclipse.ui.texteditor.HippieProposalProcessor 的导入,这使得该类在代码中可见。

That doesn't matter. If you look at the source, there is an import for org.eclipse.ui.texteditor.HippieProposalProcessor in HippieProposalComputer which makes the class visible in the code.

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