Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 261031 - [CommonNavigator] IPipelinedContentProvider getParent() returning the suggested parent is not ignored
Summary: [CommonNavigator] IPipelinedContentProvider getParent() returning the suggest...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: Francis Upton IV CLA
QA Contact:
URL:
Whiteboard: linkEditor
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-14 10:47 EST by Andrew Gvozdev CLA
Modified: 2010-04-28 13:35 EDT (History)
3 users (show)

See Also:


Attachments
Patch proposal (1.13 KB, patch)
2009-02-09 08:20 EST, Anton Leherbauer CLA
francisu: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Gvozdev CLA 2009-01-14 10:47:59 EST
"Link with Editor" neglects to expand the tree in Project Explorer for not C/C++ file types after reopening eclipse.

My case:
1. Create a new subfolder in C/C++ project. Place there a new file with non-C/C++ extension like hello.txt. Open the file with text editor.
2. Quit and reenter eclipse. It should open hello.txt in editor at that point.
3. In Project Explorer, push button "Link with Editor". I expect the tree to be expanded and the cursor placed on hello.txt at that point. As a side note, the button is actually named "Link open editors with content in the Navigator" (???). Well, that appears to be absolutely true and if you open Navigator it is linked. But what about linking in Project Explorer?
Comment 1 Anton Leherbauer CLA 2009-01-15 08:28:37 EST
I can reproduce when both CDT and Java content extensions are enabled. It works when only one of them or none is enabled. The issue is that the parent computation for the file should result in a CContainer object (from the CDT extension), but this is overridden by the Java extension in org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider.findParent(NavigatorContentExtension, Object, Object).
A possible solution would be to ignore the overriding extension if the returned parent equals the original parent.
Moving to Platform/UI for consideration.

> As a side note, the
> button is actually named "Link open editors with content in the Navigator"
I think this is already covered by bug 187137.
Comment 2 Anton Leherbauer CLA 2009-02-09 08:20:02 EST
Created attachment 125124 [details]
Patch proposal

This patch implements the fix outlined above. The basic idea is that any pipeline content extension which returns the same (equals()) parent as the original content extension should be interpreted as "non-overriding" so that it does not inadvertently revert the overridden parent from another extension.
Comment 3 Andrew Gvozdev CLA 2009-02-09 10:07:39 EST
This patch is very small but this problem stands on the way all the time in our workflow. May I ask for this patch to be reviewed soon? Our in-house build system provides some kind of manifest file with parameters and instructions for make (this is C/C++) in each folder. The name of the file is always the same and it has no extension. It is very much difficult to figure out which file you are in and navigate to the source folder as the path is 10 levels deep.
Comment 4 Francis Upton IV CLA 2009-02-10 01:33:28 EST
(In reply to comment #3)
> This patch is very small but this problem stands on the way all the time in our
> workflow. May I ask for this patch to be reviewed soon? Our in-house build
> system provides some kind of manifest file with parameters and instructions for
> make (this is C/C++) in each folder. The name of the file is always the same
> and it has no extension. It is very much difficult to figure out which file you
> are in and navigate to the source folder as the path is 10 levels deep.
> 

I will try to get this into M6, or RC0.  I know the change is small, but I would not commit a change like this unless I have a test case that shows the problem (which I will have to prepare and which takes time).  If you want to expedite the process, I would encourage you (or someone) to add a test case for this to the org.eclipse.ui.test.navigator test suite.
Comment 5 Francis Upton IV CLA 2010-04-21 07:18:26 EDT
Released to HEAD 3.6M7

Andrew, can you pick up tonight's nightly (N20100421) and verify this fix?

Anton, thank you for your contribution; I think it make sense to align the getPipelinedParent() with the other two get methods and allow them to not influence the outcome. I changed the Javadoc to reflect this.
Comment 6 Francis Upton IV CLA 2010-04-27 16:13:13 EDT
Andrew, can you verify this fix against any I build after I20100426?
Comment 7 Andrew Gvozdev CLA 2010-04-28 13:01:23 EDT
It worked for me with I20100428-0100. Thanks for the fix.