Eclipse 大纲视图为空

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8504740/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 20:46:06  来源:igfitidea点击:

Eclipse Outline View is empty

eclipse

提问by Dori

A simple one today. My Outlineview in eclipse does not show me any methods or fields anymore. I have selected the few options that are available in the outline view menu to show me everything possible but still nothing.

今天一个简单的。我Outline在 eclipse 中的视图不再向我显示任何方法或字段。我选择了大纲视图菜单中可用的几个选项来向我展示所有可能但仍然没有的选项。

If I right click in the class editor and select Quick OutlineI get the info that used to appear in the Outlineview. What gives?!

如果我在类编辑器中右键单击并选择,Quick Outline我将获得过去出现在Outline视图中的信息。是什么赋予了?!

Any help?

有什么帮助吗?

Thanks

谢谢

EDIT: i now just use IntelliJ!

编辑:我现在只使用 IntelliJ!

回答by PointedEars

Apparently the reason for this problem is that the DLTK (Dynamic Languages ToolKit)index is borken.

显然这个问题的原因是DLTK (Dynamic Languages ToolKit)索引被破坏了。

Following Five tips for speeding up Eclipse PDT and nWire, I have closed Eclipse, and only deleted the h2 database (*.db) files in <workspace>/.metadata/.plugins/org.eclipse.dltk.core.index.sql.h2/.

遵循加快 Eclipse PDT 和 nWire 的五个技巧,我关闭了 Eclipse,只删除了.h2数据库 ( *.db) 文件<workspace>/.metadata/.plugins/org.eclipse.dltk.core.index.sql.h2/

When restarting Eclipse, the databases files are created again, and after that the Outline View is working again. IIRC, this is the second time that I had this problem (first with Eclipse 3.7.x and now 4.2) and that this solution worked for me.

重新启动 Eclipse 时,将再次创建数据库文件,然后大纲视图再次工作。IIRC,这是我第二次遇到这个问题(首先是 Eclipse 3.7.x,现在是 4.2)并且这个解决方案对我有用。

回答by Jed Schaaf

I had the same issue where the Outline was empty and the code was not syntax-highlighted.

我遇到了同样的问题,即 Outline 为空且代码未突出显示语法。

To fix it, I right-clicked the file and selected Open With>Java Editor.

为了修复它,我右键单击该文件并选择“打开方式”>“Java 编辑器”。

For some reason, Eclipse thought that it should open this particular .java file with the Text Editor instead of the Java Editor.

出于某种原因,Eclipse 认为它应该使用文本编辑器而不是 Java 编辑器打开这个特定的 .java 文件。

回答by Dori

I solved this in the end by just deleting my Workspaces .metadata folder (rm -rf .metadataOSX). I lost any workspace settings but this for was a few formatting rules, refs to projects (just imported them again) and some custom key shortcuts.

我最终通过删除我的 Workspaces .metadata 文件夹(rm -rf .metadataOSX)解决了这个问题。我丢失了任何工作区设置,但这是一些格式规则、对项目的引用(刚刚再次导入它们)和一些自定义快捷键。

My outline works again!

我的大纲又起作用了!

回答by Eranda

I solved this by navigating to /workspace/.metadata/.plugins/org.eclipse.cdt.coreand deleting the .pdomfile that corresponds to my project

我通过导航到/workspace/.metadata/.plugins/org.eclipse.cdt.core并删除与我的项目对应的.pdom文件解决了这个问题

回答by Lawn

In Window>Show View>Outline I, too, had the message "Outline view is empty". It was sufficient (Eclipse 4.3.2) to press CTL+O to call the QuickOutline and then the Outline view was filled automatically. I suggest not deleting .metadata because you need it :-)

在窗口>显示视图>大纲中,我也有消息“大纲视图为空”。按 CTL+O 调用 QuickOutline 就足够了(Eclipse 4.3.2),然后 Outline 视图会自动填充。我建议不要删除 .metadata 因为你需要它:-)

回答by dimitrisli

A couple of ideas:

几个想法:

  • Have you clicked the Link with Editorbutton on the Outline view to ensure the view reflects the currently open Java file?
  • Is the java class in a source dir as per Eclipse? Right click on the project> Build path> Configure Build Path> Source tab: The package structure of your class should be under one of these source folders.
  • (a bit paranoid but just checking) Has your java class have the .javafile extension?
  • Does the Outline view working in any other project?
  • Precaution measure: Restart Eclipse to see whether this changes anything.
  • If Ctrl+ o(quick view) works then there must be something wrong with the Outline view itself: Double check in the drop down-menu Filtersnothing is filtered out and same for the Visible Categoriessection.
  • 您是否单击了Link with EditorOutline 视图上的按钮以确保该视图反映当前打开的 Java 文件?
  • 根据 Eclipse,java 类是否在源目录中?Right click on the project> Build path> Configure Build Path> Source tab:你的类的包结构应该在这些源文件夹之一下。
  • (有点偏执但只是检查)你的java类有.java文件扩展名吗?
  • 大纲视图是否适用于任何其他项目?
  • 预防措施:重新启动 Eclipse 以查看是否有任何改变。
  • 如果Ctrl+ o(快速视图)有效,那么大纲视图本身一定有问题:仔细检查下拉菜单中的Filters任何内容都没有被过滤掉,该Visible Categories部分也是如此。

回答by Tranz

If you don't want to delete all your perfs, here's my solution:

如果您不想删除所有性能,这是我的解决方案:

  • close eclipse

  • open the file at path:

  • 日食

  • 在路径打开文件:

workspace\.metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.jst.jsp.ui.prefs

工作区\.metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.jst.jsp.ui.prefs

  • search the keyword:"outlineand delete those lines.
  • 搜索关键字:”outline并删除这些行。

回答by Chris

I had the problem with my Eclipse PDT 3.2.0 and I fixed it by correcting something that apparently threw off the content parser. How I found it:

我的 Eclipse PDT 3.2.0 出现了问题,我通过更正显然抛弃内容解析器的内容来修复它。我是如何找到它的:

  1. Only one file was affected, so the outline was not in itself broken.
  2. When I deleted the whole content of the class and just left the bones of it, the outline started showing things (well an empty class), so it was something with the content.
  3. Then I went through the functions of the class and deleted one function after another until it started working which gave me the function that broke it.
  4. I ended up basically deleting line after line until I ended up looking at something funny:

    throw(new Something_Exception($msg));

  1. 只有一个文件受到影响,所以大纲本身并没有被破坏。
  2. 当我删除了课程的全部内容并只留下了它的骨架时,大纲开始显示内容(这是一个空课程),因此它与内容有关。
  3. 然后我浏览了该类的函数并删除了一个又一个函数,直到它开始工作,这给了我破坏它的函数。
  4. 我最终基本上是一行一行地删除,直到我看到一些有趣的东西:

    抛出(新的东西_异常($ msg));

When I deleted the outer parens (on all three occurrences of this), the outline came back to life.

当我删除外部括号(在所有三个事件中)时,大纲又恢复了生机。

回答by cint

I got the similar problem in PDT. Click the Outline view, but no response. Ctrl + O(Quick View) works. But the options (drop down-menu Filters) in outline view is also missing.

我在 PDT 中遇到了类似的问题。单击大纲视图,但没有响应。Ctrl + O(快速查看)有效。但是大纲视图中的选项(下拉菜单过滤器)也丢失了。

I tried to delete DLTK h2 database (*.db) files, but it doesn't work in my case.

我试图删除 DLTK h2 数据库 (*.db) 文件,但在我的情况下不起作用。

Finally, I solved by below methods:

最后,我通过以下方法解决了:

Method 1: As suggested, delete the whole .metadata folder (but lose all setting).
Method 2: Create new Window in Eclipse (Window> New Window).

方法 1:按照建议,删除整个 .metadata 文件夹(但丢失所有设置)。
方法 2:在 Eclipse ( Window> New Window) 中创建新窗口。

回答by Petr Ga?orek

The same problem, Kepler Service Release 1, PDT 3.2.0.

同样的问题,Kepler Service Release 1,PDT 3.2.0。

Solution: I deleted the whole content of the class and saved file. Outline started. I restored content of the class and outline is OK.

解决方案:我删除了课程的全部内容并保存了文件。大纲开始。我恢复了课程的内容,大纲没问题。