14

A simple one today. My Outline view 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.

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

Any help?

Thanks

EDIT: i now just use IntelliJ!

Dori
  • 18,283
  • 17
  • 74
  • 116
  • This happened to me when I started messing around with Javadoc `@category` tags in Kepler. Once I added a `@category` tag, nothing else without that tag would show an outline. Then when I tried to back out by deleting all the `@category` tags I added, nothing anywhere would show the Outline. Not even in classes for which I never added a `@category` tag. (Note, Quick Outline continued to work as you described.) – martinez314 May 06 '14 at 13:51

17 Answers17

9

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

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/.

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.

PointedEars
  • 14,752
  • 4
  • 34
  • 33
6

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

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

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

Jed Schaaf
  • 1,045
  • 1
  • 10
  • 19
5

I solved this in the end by just deleting my Workspaces .metadata folder (rm -rf .metadata OSX). 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.

My outline works again!

Dori
  • 18,283
  • 17
  • 74
  • 116
4

I solved this by navigating to /workspace/.metadata/.plugins/org.eclipse.cdt.core and deleting the .pdom file that corresponds to my project

il_guru
  • 8,383
  • 2
  • 42
  • 51
Eranda
  • 41
  • 2
3

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 :-)

Lawn
  • 41
  • 1
3

A couple of ideas:

  • Have you clicked the Link with Editor button 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 .java file 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 Filters nothing is filtered out and same for the Visible Categories section.
dimitrisli
  • 20,895
  • 12
  • 59
  • 63
  • I've added a couple of more ideas – dimitrisli Dec 14 '11 at 17:27
  • does not work in other projects - restart does not fix - it does work for xml files still though – Dori Dec 14 '11 at 17:38
  • if quick view is working then there is something with the View Outline settings. Have a look in Filters and Visible Categories to check whether you are filter anything out. – dimitrisli Dec 14 '11 at 17:44
  • Visible Categories is totally empty, filters is empty / everything unchecked – Dori Dec 14 '11 at 17:54
  • mmm.. Try to create a new Project and if still the same try to create a new Eclipse Workspace – dimitrisli Dec 14 '11 at 18:06
  • I have come across something like this ages ago and had to clear my workspace settings, very irritating, there must be a simple solution somewhere! – Dori Dec 14 '11 at 18:11
  • if i create a new workspace it works again so I have just reset my current workspace. See my answer below. +1 for the help :) – Dori Dec 15 '11 at 11:41
1

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

  • search the keyword:"outline and delete those lines.
Tranz
  • 167
  • 1
  • 9
0

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:

  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));

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

Chris
  • 5,788
  • 4
  • 29
  • 40
0

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.

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

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).

cint
  • 93
  • 1
  • 6
0

The same problem, 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.

0

I had the same exact issue, however I am using MyEclipse. For me, simply restarting the IDE resolved the issue. Not sure what caused it, possibly switching perspectives? Anywho, just thought I'd throw this out there for informational purposes.

heez
  • 2,029
  • 3
  • 27
  • 39
0

Tranz's response worked fine for me, even though the path to the file is slightly different (I am using Eclipse Luna):

.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs

After deleting those lines and restarting Eclipse, the Outline works fine again.

Jordan
  • 390
  • 4
  • 9
0

With Javascript (Rhino) code I had the problem when I used const variables. As soon as I changed them to var variables, the outline appeared again.

Darek Kay
  • 15,827
  • 7
  • 64
  • 61
Mike
  • 2,098
  • 1
  • 11
  • 18
0

If the Java file/files does not show in the outline

  1. move the file out elsewhere

  2. do a refresh

  3. move back the file

  4. do a refresh again

the outline will be populated again

Aaron Gong
  • 977
  • 7
  • 18
0

I had the same issue with eclipse oxygen today and the reason was the missing scala library in the scala project. the problem is reported in the eclipse problems tab: "Unable to find a scala library. Please add the scala container or a scala library jar to the build path."

The solution for me, that let the outline to be filled as well, has been:

  • on the eclipse Project menu, select Properties
  • select the Java Build Path item and then the Libraries path
  • press the Add Library button, then select Scala Library
0

This works in my case:

  1. Reinstall Eclipse.
  2. Help -> Eclipse Marketplace -> directly install the windows builder.
  3. Upgrade my JDK from version 11 to 15.

Good luck!

סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68
0

I recently experienced this issue. In Window > Show View > Outline I had the message "There is no active editor that provides an outline."

It used to be working fine and I am not really sure what happened/I did to break it. I checked my other projects and they did not have any issues with outline view. After trying many of the solutions suggested here I ended up creating a new workspace and importing my project again just to have a clean slate. Now I have the outline view.

Zeynep
  • 1
  • 1