关于类在 Eclipse 包中的位置的澄清
如果之前有人问过这个问题,请忽略它。我正在研究在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您错误地认为包名称和插件名称紧密相连。他们不是。
在您的情况下,
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 inorg.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.那没关系。如果您查看源代码,就会发现
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
inHippieProposalComputer
which makes the class visible in the code.