static public Path locateProjectDir(Path location) {
		if (!Files.isDirectory(location)) {
			// peek into file and find package statement - then start searching from that
			// root instead.
			try {
				String pkg = Util.getSourcePackage(Util.readString(location)).orElse("");
				if (!"".equals(pkg)) { // if package found try resolve matching parent dirs
					String parentPath = pkg.replace(".", "/");
					if (safeParent(location).endsWith(parentPath)) {
						String relativeParent = String.join("/", Collections.nCopies(pkg.indexOf(".") + 1, ".."));
						location = safeParent(location).resolve(relativeParent);
					} else {
						location = safeParent(location);
					}
				} else {
					location = safeParent(location);
				}
			} catch (IOException e) {
				Util.verboseMsg("Could not read package from " + location, e);
				// ignore
			}
		}
		// once we have a initial root dir to search from based on package or dir.
		// Look for first level project markers by finding editor metadata
		Path nearestRoot = findNearestRoot(location, editorRootMarkers);
		if (nearestRoot == null) {
			// if no edit location found try build projects
			nearestRoot = findNearestRoot(location, buildRootMarkers);
		}
		if (nearestRoot != null) {
			Util.verboseMsg("Found project root for edit: " + nearestRoot);
			location = safeParent(nearestRoot);
		}
		return location.normalize();
	}
Returns a parent path if one of the targetFileNames exist in such parent.

@param filePath
@param targetFileNames list of markers to search for
@return if found returns the marker path, if none found return null.
src/main/java/dev/jbang/cli/Edit.java