Dori
Dori

Reputation: 18423

Eclipse Outline View is empty

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!

Upvotes: 15

Views: 40746

Answers (17)

PointedEars
PointedEars

Reputation: 14980

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

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.

Upvotes: 9

Zeynep
Zeynep

Reputation: 11

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.

Upvotes: 1

brnslzar_26
brnslzar_26

Reputation: 1

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!

Upvotes: 0

Alessandro Caproni
Alessandro Caproni

Reputation: 83

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

Upvotes: 0

Jed Schaaf
Jed Schaaf

Reputation: 1127

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.

Upvotes: 7

Aaron Gong
Aaron Gong

Reputation: 1015

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

Upvotes: 0

Mike
Mike

Reputation: 2346

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.

Upvotes: 0

Lawn
Lawn

Reputation: 41

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

Upvotes: 3

Jordan
Jordan

Reputation: 390

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.

Upvotes: 0

heez
heez

Reputation: 2689

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.

Upvotes: 0

Petr Gaďorek
Petr Gaďorek

Reputation: 1

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.

Upvotes: 0

cint
cint

Reputation: 93

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

Upvotes: 0

Chris
Chris

Reputation: 6203

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.

Upvotes: 0

Tranz
Tranz

Reputation: 167

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.

Upvotes: 1

Eranda
Eranda

Reputation: 41

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

Upvotes: 4

Dori
Dori

Reputation: 18423

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!

Upvotes: 5

dimitrisli
dimitrisli

Reputation: 21411

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.

Upvotes: 3

Related Questions