eclipsercp-如何重建项目的索引?

af7jpaap  于 2021-07-13  发布在  Java
关注(0)|答案(2)|浏览(232)

我正在开发一个创建c项目的eclipse插件。
如何以编程方式执行以下操作:
右键单击项目->索引->重建
谢谢!

xzlaal3s

xzlaal3s1#

我假设您正在为eclipsecdt开发一个插件。
如果没有更多的背景,我不能给你一个完整的答案。但是,eclipse cdt项目的索引可以重建如下:

CCorePlugin.getIndexManager().reindex(project); // reindex
                                                // note: project is an ICProject
CCorePlugin.getIndexManager().joinIndexer(IIndexManager.FOREVER, pm); // wait for the indexing job to complete.

为了访问类 CCorePlugin 您需要向bundle添加依赖项 org.eclipse.cdt.core 到插件的manifest.mf。

gfttwv5a

gfttwv5a2#

在我的eclipse中,项目的上下文菜单中没有“索引”。你知道间谍插件吗?您可以获得有关活动视图的信息,也许您可以找到相关的信息。
阅读更多http://www.vogella.com/tutorials/eclipsecodeaccess/article.html#pluginspy

相关问题