package org.eclipse.ec4e.internal.resource;

import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Path;
import org.eclipse.ec4j.core.ResourcePaths.ResourcePath;
import org.eclipse.ec4j.core.Resources.Resource;

/**
 * A {@link ResourcePath} implementation based on {@link IContainer}.
 *
 * @author <a href="https://github.com/ppalaga">Peter Palaga</a>
 */
public class ContainerResourcePath implements ResourcePath {

	private final IContainer container;

	ContainerResourcePath(IContainer container) {
		this.container = container;
	}

	@Override
	public ResourcePath getParent() {
		IContainer parent = container.getParent();
		if (parent == null || parent.getType() == IResource.ROOT) {
			return null;
		}
		// Search '.editorconfig' files only in project and folders container.
		return new ContainerResourcePath(parent);
	}

	@Override
	public String getPath() {
		return container.getLocation().toString().replaceAll("[\\\\]", "/");
	}

	@Override
	public boolean hasParent() {
		IContainer parent = container.getParent();
		return parent != null;
	}

	@Override
	public Resource resolve(String name) {
		IFile child = container.getFile(new Path(name));
		return new FileResource(child);
	}

}
@@ -694,81 +694,21 @@
 %7B%0A%09%09
-IContainer parent = container.getParent();%0A%09%09if (parent == null %7C%7C parent
+if (container
 .get
@@ -731,19 +731,22 @@
 rce.
+P
 RO
-O
+JEC
 T) %7B%0A%09%09%09
 retu
@@ -745,37 +745,31 @@
 %0A%09%09%09
-return null;%0A%09%09%7D%0A%09%09// S
+// Stop the s
 earch 
+of  
 '.ed
@@ -790,55 +790,129 @@
 les 
-only in project and folders container.%0A%09%09return
+in the parent container%0A%09%09%09return null;%0A%09%09%7D%0A%09%09IContainer parent = container.getParent();%0A%09%09return parent == null ? null :
  new

Stop the search of '.editorconfig' files in the parent container