1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Patch by ashish for Bug 161529 - Open Include from the Outline view does not automatically resolve the include file

This commit is contained in:
Anton Leherbauer 2006-10-23 10:55:33 +00:00
parent b916d1065e
commit 28b8e38cb1

View file

@ -207,7 +207,11 @@ public class OpenIncludeAction extends Action {
public boolean visit(IResourceProxy proxy) throws CoreException {
if (proxy.getType() == IResource.FILE && proxy.getName().equalsIgnoreCase(name.lastSegment())) {
list.add(proxy.requestResource().getLocation());
IPath rPath = proxy.requestResource().getLocation();
int numSegToRemove = rPath.segmentCount() - name.segmentCount();
IPath sPath = rPath.removeFirstSegments(numSegToRemove);
if (sPath.equals(name))
list.add(rPath);
return false;
}
return true;