Community
Participate
Working Groups
- Create two classes: p1.Class1 and p1.Class2 - Open type hierarcy for the p1.Class1 - In some external editor change p1.Class2 by additing "extends Class1" statement - Go to the Eclipse and invoke "refresh" action for this project from navigator -> type hierarchy for Class1 would not be changed. Same action performed from the editor cause correct refresh of TypeHierarchy on saving the file. Seems like the changes which was not done inside the "working copy" of corresponding ICompilationUnit would be reported incorrestly and would not refresh corresponding TypeHierarchy. We have some code which changes ICompilationUnits (without creation of WorkingCopy) it seems working correctly except of refreshing TypeHierarcy...
Type hierarchies involving types being edited are using shared working copies, instead of compilation unit elements. At first glance, the refresh should still occur. Need to investigate.
In our code this problem was fixed by switching to "working copy mode". Once I perform changes in newly created working copy (not shared) and commit this changes at the end of operation - everything works Ok (type hierarchy refreshed)
Alex, are you saying the problem was in your code?
No.. ;-) We have work-arounded this problem by intruducing working copies (NOT SHARED). But, as I mentioned in the very beginning of this bug report, this problem reproducable with "pure eclipse" (without introducing any additional code into it)
If the change is made in the Java editor, a working copy is used and a FINE_GRAINED delta is fired. It contains enough information (namely the supertype has changed) to determine that the hierarchy needs to be refreshed. If the change is made in an external editor, the project refresh triggers a delta saying that the compilation unit has changed, but no more information can be inferred without opening the compilation unit.
Performance wise, this would be too costly to open all compilation units that changed to see if the hierarchy needs to be refreshed. Using the Java editor doesn't show the problem. Using an external editor, your workaround is the right thing to do. Marking as WONTFIX.