NitorCreations / RobotFramework-EclipseIDE

Developing an Eclipse IDE for the Robot Framework test automation tool
71 stars 53 forks source link

Opening files by navigating (Ctrl-click) indicates they belong to wrong maven project in Package Explorer #34

Closed xkr47 closed 11 years ago

xkr47 commented 11 years ago

When having a maven project with subprojects, opening a robot text file in a subproject and then navigating through some hyperlink (ctrl-click) to another robot text file, Package Explorer incorrectly indicates (when "Link with Editor" is enabled) that the opened robot text file belongs to the root eclipse project instead of the (same) subproject that the file resides in. The correct file is obviously being edited, but Package Explorer incorrectly identifies which project it belongs to.

xkr47 commented 11 years ago

The problem seems to be in the way Eclipse identifies which project a resource belongs to.

In org.eclipse.core.internal.localstore.FileSystemResourceManager.resourceForLocation(), it takes the first project whose root directory is a prefix of the file in question. To get the correct result in this case, when nested projects cause multiple projects' roots' prefixes to match, it would have to find the project with the longest matching prefix instead of the first one.

Update: Alternatively M2E fails to filter resources properly from parent projects (since resourceForLocation() supports skipping filtered resources)

xkr47 commented 11 years ago

Included in release 1.1.0.